Join GitHub today
Address in mailbox given does not comply with RFC 2822, 3.6.2. #382
The exception itself says there is something wrong in email address fields such as From, Sender or Reply-To fields. Swift Mailer strictly follow RFC standard to avoid emails being caught by spam checker tools. There are following reason can lead to this error.
Incorrect email address format in to,from or reply-to fields
Before applying please check Swift Mailer documentation on how to set To,From,Cc, Bcc, Reply To fields correctly in Swift Mailer.
How To Disable RFC Standard Check
Go to swiftmailer\classes\Swift\Mime\Headers folder and open MailboxHeader.php file in editor. Go to line number 304 and comment throw exception line as specified below.
For Symfony users: swift mailer library can be found in vendor folder.
private function _assertValidAddress($address)
I still have some warnings in the logs, be carefull.
Why not change this code:
if (!preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', $address))
if (0 === preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', $address))
added a commit
Nov 20, 2015
Seems like an old issue, but I don't know where to post this.
I'm using mailgun.com service, and there is a feature of batch sending emails, by defining receiver as
It would be great, if there would be a way to redefine Swift_Mime_Grammar as DI and create interface for it?