send email to different targets based on config
This commit is contained in:
parent
326457cca3
commit
4fb0764bcc
5 changed files with 150 additions and 25 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue