You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had a similar problem since we get people's names from a third party which includes a department suffixed to the last name which includes square brackets.
mail[:to].errors# => [["To", "Kris Leech [TECH] <[email protected]>", #<Mail::Field::IncompleteParseError: Mail::AddressList can not parse |Kris Leech [TECH] <[email protected]>|: Only able to parse up to "Kris Leech ">]]
If you are constructing the "to" yourself you can quote the name part:
QuoteName=Class.newdoextendMail::Utilitiesdefself.call(name)quote_phrase(name)endendto="#{QuoteName.('Kris Leech [TECH]')} <[email protected]>"mail=Mail.new{to(to)}mail[:to].addrs# => no error
I got this error when trying to send an SMTP email with a close round bracket (
Net::SMTPFatalError
Test SendMail ) <[email protected]> Invalid email address.
If I removed the bracket (. It can send an email successfully.
Test SendMail <[email protected]>
Here is the log:
Could the code be changed to support if we send an email with a single round bracket?
The text was updated successfully, but these errors were encountered: