go-gomail / gomail

The best way to send emails in Go.
MIT License
4.29k stars 569 forks source link

How change enconding from 8bit to quote-printable? #162

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi, in my go app I use go mail to sand emails to a local postfix server. For do that i use this code:

Dialer := gomail.NewDialer("localhost", 25, "", "")
Dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}

gm := gomail.NewMessage()

gm.SetHeader("From", "my-mail@address.com")
gm.SetHeader("To", "dest@mail.com")
gm.SetHeader("Subject", "Mail Subject")

Dialer.DialAndSend(gm)

My intent is to use Quoted Printable Encoding. The NewMessage function, reading the code, by default set the encoding in correct way. But when i send the email to postfix there is always an enconding setting set to "8bit":

*** ENVELOPE RECORDS deferred/6/6A42A5608A ***
...

named_attribute: encoding=8bit

...

How i can change this from 8bitto quote-printable?

Thanks