Open StevenOng97 opened 1 year ago
Your gomail.SendFunc
basically only prints out the "From" and "To" fields of the mail but does not perform any sending operation. You followed the "No SMTP" example which basically means it does not send the mail via SMTP and leaves it up to you to write your own delivery function. Why did you chose this example when you are expecting to send mails?
Hi @alexcesaro , I followed the guide from our documentation but don't receive any email. Even no error throw from the log.
m := gomail.NewMessage() m.SetHeader("From", "from@example.com") m.SetHeader("To", "to@example.com") m.SetHeader("Subject", "Hello!") m.SetBody("text/plain", "Hello!")
s := gomail.SendFunc(func(from string, to []string, msg io.WriterTo) error { // Implements you email-sending function, for example by calling // an API, or running postfix, etc. fmt.Println("From:", from) fmt.Println("To:", to) return nil })
if err := gomail.Send(s, m); err != nil { panic(err) }