send email to different targets based on config

This commit is contained in:
Felipe M 2024-11-21 23:16:11 +01:00
parent 326457cca3
commit 4fb0764bcc
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
5 changed files with 150 additions and 25 deletions

View file

@ -63,8 +63,8 @@ func main() {
hostname := "localhost"
auth := NewPlainClient("", "username", "password")
// auth := NewAnonymousClient("test")
recipients := []string{"test@test.com"}
msg := []byte("hello!")
recipients := []string{"something@something.com", "caca@caca.com"}
msg := []byte("\r\nwithout title")
from := "hello@localhost"
err := smtp.SendMail(hostname+":11025", auth, from, recipients, msg)
if err != nil {