Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Setting the mail sender's name, fix issue #448 #633
Gmail appears to be not accepting characters like "<" and ">" into the 'From' field (at the Send method).
However, gmail accepts the syntax
So the fix is just send only the email(without alias and special chars) at Send method.
changed the title from
Sanitize 'From' field, fix issue #448
Setting the mail sender's name, fix issue #448
Jun 5, 2014
With current version, the test code below returns syntax error:
But, if we remove the FROM_NAME...
The email will be sent with no returning errors.
I checked the RFC 5321, which specify the Simple Mail Transfer Protocol and found this
That occurs at 'MAIL command'.
Note, that the message header "From:" accepts the format 'FROM_NAME <FROM_EMAIL>', as described by http://tools.ietf.org/html/rfc5322#section-3.4
So, my code proposes that we continue using &mail.Sender.From, but now we can set the Sender Name without messing with the 'MAIL command'.
Hope that it helps. =]
Cool, makes sense. Your original post was a bit misleading since you had used
Shouldn't we do the same for the
Curious, why not just separate the sender's name and email address in the
PS - @maiconio we need you to target the
@revel/core Why do we even have our own mailer? Why aren't using/supporting an existing package? Seems we're duplicating effort needlessly here. I see no benefit to having a Revel-specific mailer package.
@brendensoares, I totally agree with your arguments:
Let me take a look at those PR's. I've been swamped the past few months with other projects but I'll address them soon.
Regardless, the core API should be stable. At this point, I won't introduce any breaking changes - and each of these PR's just seem to be convenience functions to add to the API.