Question about mass mail function

Thread Solved

Join Date: May 2009
Posts: 15
Reputation: violarisgeorge is an unknown quantity at this point 
Solved Threads: 3
violarisgeorge's Avatar
violarisgeorge violarisgeorge is offline Offline
Newbie Poster

Question about mass mail function

 
0
  #1
24 Days Ago
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
Last edited by violarisgeorge; 24 Days Ago at 7:55 pm.
I take your reality and substitute my own
violarisgeorge.com
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
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.
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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 432
Reputation: Atli is on a distinguished road 
Solved Threads: 56
Atli's Avatar
Atli Atli is offline Offline
Posting Pro in Training
 
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
Please do not ask for help in a PM. Use the forums.
And use [code] tags!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 432
Reputation: Atli is on a distinguished road 
Solved Threads: 56
Atli's Avatar
Atli Atli is offline Offline
Posting Pro in Training
 
1
  #4
24 Days Ago
As an afterthought...
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!
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 15
Reputation: violarisgeorge is an unknown quantity at this point 
Solved Threads: 3
violarisgeorge's Avatar
violarisgeorge violarisgeorge is offline Offline
Newbie Poster
 
0
  #5
24 Days Ago
Originally Posted by Atli View Post
As an afterthought...
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.
Hmmm, yeah, thanks for the link to the spec! So cool, no loops or anything needed, also I could store the recipients as a string var resulting from an array maybe... I should try this in the morning when I wake up, as this would allow for automatically populating the recipients!

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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC