An easy way to send emails with attachments
Send attachments
m := email.NewMessage("Hi", "this is the body")
m.From = "[email protected]"
m.To = []string{"[email protected]"}
err := m.Attach("picture.png")
if err != nil {
log.Println(err)
}
err = email.Send("smtp.gmail.com:587", smtp.PlainAuth("", "user", "password", "smtp.gmail.com"), m)
Send unencrypted password
err = email.SendUnencrypted("mail.example.com:25", "user", "password", m)