Address in mailbox given does not comply with RFC 2822, 3.6.2. #382
Comments
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) |
its didnt help me |
Its help me - before send message I do mysql_real_escape_string() |
Comment deleted due to factual error. Apologies. |
For googlers, I had the same issue. The problem was the PCRE lib version used by the mod_php which dont want to compile the regex used by swiftmailer to check addresses. (there is a warning the the php logs). |
Lou: which one did you use? Thanks! |
@bastianmartin I did not change the pcre lib because I dont have the right on the server. I just made an ugly fork and removed the check. See LouTerrailloune/swiftmailer@d71ecbb . |
@LouTerrailloune Thank you! I'm trying to update PHP libs - maybe it was already fixed. Otherwise I'm gonna comment that too... damn ;-) |
I still have some warnings in the logs, be carefull. |
Thanks - I've updated PHP to the latest DotDeb Build (5.6.10) and the issue is gone. |
Why not change this code: if (!preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', $address)) With this: if (0 === preg_match('/^' . $this->getGrammar()->getDefinition('addr-spec') . '$/D', $address)) Then, any |
plz make sure there is no white space before or after the email address given |
It's your role to use |
In my case, PHP was the culprit. After updating to 5.6.10 (without changing the existing PHP code) the issue was gone. However, I also think that Swiftmailer should use |
In my case, it works after updating PHP from 5.5.25 to 5.5.28. |
in my case it was a blank bcc |
i used iconv() and trim() to fix this issue |
trim() helps me too ^^) |
same error here. Trim not helped me. This are the emails that throw the error: célian.schmitt@example.com Really i don't want to send those emails, it's just a simulation, but this error break it. |
Mandrill gives me an SMTP username that is not valid email address and SwiftMailer is throwing an error. |
Hello! I can't to send any e-mail with addresses пример@пример.рф or example@пример.рф and get the same error. Google supports this addresses. Why are you not support it? |
Hello! 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? |
Closing as the email validation is now done by an external library that you can configure (Swiftmailer 6+). |
Work for me just fine |
You should convert your пример.рф domain into IDNA format like 'xn--e1afmkfd.xn--p1ai' |
i was also getting this problem when i was sending multiple emails at a time and there was email duplication passed in bcc , to , CC methods
|
Simply change 👍
and |
For me, it was empty email address sent to setReplyTo(). Fixed by not calling this method if reply-to is absent. I think, the same would be with setFrom, setCc, setBcc. |
In my case it was a blank bcc, too! |
In my case was empty "To Name" |
@drudriger Good finding. Would you like to work on a fix? I suppose that the conversion to an email address is wrong when the name is empty. |
I spend around 2 hours, find the problem. But me problem was not that name was empty, but because I give to the method like this |
|
This looks like a very old question. Recently, I've got an error like this because i have put the email address in the name argument and vice versa. Maybe this comment can help someone... |
When i try to send a newsletter i have this error :
Address in mailbox given [agence-immobiliere-aaaaaaaa@wanadoo.fr ] does not comply with RFC 2822, 3.6.2.
I don't understand what is wrong because this address realy exist...
The text was updated successfully, but these errors were encountered: