DeanWhitehouse Posted June 29, 2008 Share Posted June 29, 2008 Does anyone have experience using PHP Mailer , as i am currently stuck trying to send a message to multiple email addresses, does anyone know how to do this. Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/ Share on other sites More sharing options...
DeanWhitehouse Posted June 29, 2008 Author Share Posted June 29, 2008 BUMP this is the address of my page http://djw-webdesign.awardspace.com/Mail%20App/mailapp.php I have tried putting in a , but that didn't work. Does anyone have any idea? Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577003 Share on other sites More sharing options...
hitman6003 Posted June 29, 2008 Share Posted June 29, 2008 After looking at their documentation for exactly 3 seconds, I found the answer...please look their first... http://phpmailer.codeworxtech.com/methods.html Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577032 Share on other sites More sharing options...
DeanWhitehouse Posted June 29, 2008 Author Share Posted June 29, 2008 Thanks, dude i was treating it like normal php mail() where you just add a , and thats it. Problem no.2 this is the bit where it gets told the recipient $mail->AddAddress($to[0]); $mail->AddAddress($to[1]); //$mail->AddAddress($to[2]); //$mail->AddAddress($to[3]); //$mail->AddAddress($to[4]); now, this won't send if there is nothing in array($to) 2,3 etc. so how i can i get it to only have the address when there is that amount, without writing an if statement for each one. e.g. i know i could od if(count($to) == 2) { $mail etc. } but is there a quicker way? Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577041 Share on other sites More sharing options...
hitman6003 Posted June 29, 2008 Share Posted June 29, 2008 use a foreach loop... foreach ($recipents as $recipient) { $mail->AddAddress($recipient); } Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577046 Share on other sites More sharing options...
DeanWhitehouse Posted June 29, 2008 Author Share Posted June 29, 2008 ok, so it would be $to = "cake,monkey,spider"; // example not what i am using, $to = explode(",",$to); foreach ($to as $tos) { $mail->AddAddress($tos); } Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577052 Share on other sites More sharing options...
DeanWhitehouse Posted June 29, 2008 Author Share Posted June 29, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577281 Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 Although I've not been involved in this thread I would suggest rather than asking if the code is right and then bumping it when no one replies, try out the code yourself and if it isn't right, report back with any errors. You're more likely to get an informative response that way Quote Link to comment https://forums.phpfreaks.com/topic/112384-php-mail-using-php-mailer/#findComment-577293 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.