mailx
mailx copied to clipboard
A lightweight SMTP mail library
mailx
A lightweight SMTP mail library
❤️ A project by txthinking.com
Install
$ go get github.com/txthinking/mailx
Example
server := &mailx.SMTP{
Server: "smtp.mailtrap.io",
Port: 465,
UserName: "e3f534cfe656f4",
Password: "b6e38ddc0f1e9d",
}
message := &mailx.Message{
From: &mail.Address{
Name: "mailx",
Address: "[email protected]",
},
To: []*mail.Address{
{
Name: "Cloud",
Address: "[email protected]",
},
},
Subject: "Hello",
Body: "I <b>love</b> U.",
Attachment: []string{
"/etc/hosts",
},
}
if err := server.Send(message); err != nil {
log.Fatal(err)
}
License
Licensed under The MIT License