go-gomail / gomail

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

Issue in assigning mail headers #166

Open amjadaliup opened 2 years ago

amjadaliup commented 2 years ago

Mail header displaying in random order, not in the order we are giving. Example:- We set headers in the following order:-

    m.SetHeader("From", from)
    m.SetHeader("Reply-To", replayTo)
    m.SetHeader("To", to)
    m.SetHeader("Subject", subject)

But in the mail we got headers in the random order. Please fix this issue at the earliest.

Thanks in advance..

andrewdsilva commented 1 year ago

You need to use this :

m.SetAddressHeader("Reply-To", replayTo)

Have a nice day