problem sending to email list
Posted: Fri Feb 11, 2011 5:17 pm
I'm using the current version of Swift Mailer. I build a string of emails separated by commas and try to send to those addresses. I've tried with both send and batchSend, but I get an error (Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given ['xyz1@comcast.net','xyz2@comcast.net'] does not comply with RFC 2822, 3.6.2..' in /var/www/XX/includes/Swift-4.0.6/lib/classes/Swift/Mime/Headers/MailboxHeader.php)
This works with a single email address, but not with more than 1.
I've tried constructing the string of emails different ways (with and without quotes), but it hits the error just the same.
or
Here's the other code:
Any suggestions?
Thank you.
This works with a single email address, but not with more than 1.
I've tried constructing the string of emails different ways (with and without quotes), but it hits the error just the same.
Code: Select all
$emailString = "'xyz1@comcast.net','xyz2@comcast.net'";Code: Select all
$emailString = "xyz1@comcast.net,xyz2@comcast.net";Code: Select all
# Create the message
$emailMessage = Swift_Message::newInstance($subjectLine)
->setFrom(array($SwiftMemberSupportEmail => $SwiftMemberSupportName))
->setTo(array($emailString))
->setBody($body)
;
# Now check if Swift actually sends it (as a batch)
if (!$result2 = $mailer->batchSend($emailMessage))Any suggestions?
Thank you.