Closed jfroy closed 9 years ago
This is on purpose. Can you show your code or describe what your trying to do? On Mar 9, 2015 5:22 AM, "Jean-Francois Roy" notifications@github.com wrote:
For example, if the character "," is present in a header field, it must be encoded because it is the address separator character in the address-list (RFC 2822) production rule.
— Reply to this email directly or view it on GitHub.
Hello, I think I have encountered this problem with the character sequence \ in the To part. Here is an ECM
package main
import (
"crypto/tls"
"gopkg.in/gomail.v1"
)
func main() {
msg := gomail.NewMessage()
msg.SetHeader("From", "pi@test.fr")
msg.SetHeader("To", msg.FormatAddress("pi@localhost", "X\\XXXXX"))
msg.SetHeader("Subject", "Test")
msg.SetBody("text/html", "Hello <b>Bob</b> and <i>Cora</i>!")
mailer := gomail.NewMailer("127.0.0.1", "no-reply@test.com", "", 25,
gomail.SetTLSConfig(&tls.Config{InsecureSkipVerify: true}))
if err := mailer.Send(msg); err != nil {
panic(err)
}
}
This fails with message panic: mail: no angle-addr
. Same error replacing \ by a comma.
Yeah I ran into this trying to send an email to someone with a ',' in their name.
Thanks guys! I just fixed that bug by quoting names in address headers.
For example, if the character "," is present in a header field, it must be encoded because it is the address separator character in the address-list (RFC 2822) production rule.