| | |
Question about mass mail function
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hey all,
I need to use the PHP mail() function in order to send an email to a number of individuals.
So lets say that I have 5 users that need to get a particular email. I was thinking that the correct way of going about using the mail() function, would be:
1) to create an array variable
2) load the 5 usernames in the array
3) then store in a variable the size of the array, i.e. in my example it is 5 positions.
4) make a for loop with its limit whatever the array size is...
5) for each iteration read the corresponding username from the array and use the mail() function to email that specific username...
The point is, does anyone know of any other function other than mail() that can take more than one recipients? That would be really helpful and actually it would be more optimal and save server time... I created a massml() function myself and it takes as recipient an array argument, it works with the specifications that I gave above. But I am using a loop inside my function so this is still the same as looping the mail() function... It's not much of a problem but the optimality of this has been bugging me since morning.
Thanks for listening, I appreciate any answers,
George
I need to use the PHP mail() function in order to send an email to a number of individuals.
So lets say that I have 5 users that need to get a particular email. I was thinking that the correct way of going about using the mail() function, would be:
1) to create an array variable
2) load the 5 usernames in the array
3) then store in a variable the size of the array, i.e. in my example it is 5 positions.
4) make a for loop with its limit whatever the array size is...
5) for each iteration read the corresponding username from the array and use the mail() function to email that specific username...
The point is, does anyone know of any other function other than mail() that can take more than one recipients? That would be really helpful and actually it would be more optimal and save server time... I created a massml() function myself and it takes as recipient an array argument, it works with the specifications that I gave above. But I am using a loop inside my function so this is still the same as looping the mail() function... It's not much of a problem but the optimality of this has been bugging me since morning.
Thanks for listening, I appreciate any answers,
George
Last edited by violarisgeorge; 24 Days Ago at 7:55 pm.
I take your reality and substitute my own
violarisgeorge.com
violarisgeorge.com
0
#2 24 Days Ago
You can specify BCC addresses in the mail function, but that way would not allow you to send personalised emails..
As far as I am aware, mail would be the best way to do this.
As far as I am aware, mail would be the best way to do this.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
0
#3 24 Days Ago
Hey.
You should check out PHPMailer or Swift Mailer.
Both are much easier to deal with than the PHP mail function, and both allow for multiple recipients.
But if you don't want that, the steps you describe for you mail script looks OK. At least on paper
You should check out PHPMailer or Swift Mailer.
Both are much easier to deal with than the PHP mail function, and both allow for multiple recipients.
But if you don't want that, the steps you describe for you mail script looks OK. At least on paper
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
1
#4 24 Days Ago
As an afterthought...
The mail function does allow for multiple recipients for one call.
If you pass something like
See the to parameter description and example #4 in the manual.
The mail function does allow for multiple recipients for one call.
If you pass something like
User1 <user1@example.com>, User2 <user2@example.com> as the first parameter, the mail would be sent to both recipients.See the to parameter description and example #4 in the manual.
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
And use [code] tags!
0
#5 24 Days Ago
•
•
•
•
As an afterthought...
The mail function does allow for multiple recipients for one call.
If you pass something likeUser1 <user1@example.com>, User2 <user2@example.com>as the first parameter, the mail would be sent to both recipients.
See the to parameter description and example #4 in the manual.
Thanks, I'll check in the morning as I said and get back at this!
I take your reality and substitute my own
violarisgeorge.com
violarisgeorge.com
![]() |
Similar Threads
- Mail function Error (PHP)
- mail function (PHP)
- mail function issue in php (PHP)
- Problems with PHP mail function. (PHP)
- Stuck on Mail() Function (PHP)
Other Threads in the PHP Forum
- Previous Thread: need help with table
- Next Thread: extract from a string
| Thread Tools | Search this Thread |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions simple sms sockets source space spam sql syntax system table tutorial update upload url validator variable video web youtube





