send email to multiple adress

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

send email to multiple adress

Post by junjustkim »

hi to all

I know how to send email in which address is from the user but it is only one email ads. I am planning to allow the user to send into multiple address using a comma or semi colon as a separator. But how can I extract that addresses and put into an array so that I can use loop. I want to use a split but i could not specified (list of variables) to be assigned from the split since I don't know how many addresses will be input from the users.

please give an advice

thanks in advance

Tirso

list($email,$email1) = split(',',$address);
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: send email to multiple adress

Post by josh »

if you have the list of emails in an array, you could loop through them and build a header string to pass to the mail function, or whatever mailer you are using
( ie. if you were using phpmailer you could call the ->addBCC() method for each email )
junjustkim
Forum Commoner
Posts: 44
Joined: Thu May 22, 2008 8:48 pm

Re: send email to multiple adress

Post by junjustkim »

Thanks for your immediate replied. Actually the list is came from the input field (type text) which inputted from the user using semi colon or even comma. My problem now is how I convert it into array in order for me to use a loop.

thanks
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: send email to multiple adress

Post by josh »

explode()
Post Reply