I am trying to send email using gomail, need to set reply-to email address. Searched a lot but did not get any relevant link.
package main
import "gopkg.in/gomail.v2"
func main() {
m := gomail.NewMessage()
m.SetAddressHeader("From", "[email protected]", "Sandy Sender")
m.SetAddressHeader("To", "[email protected]")
m.SetHeader("Subject", "Hello!")
m.SetBody("text/plain", "This is the body of the message.")
d := gomail.NewPlainDialer("smtp.example.com", 587, "user", "123456")
if err := d.DialAndSend(m); err != nil {
panic(err)
}
}
You can set the
Reply-Toheader for that effect: