Improved example readability

This commit is contained in:
Alexandre Cesaro 2015-09-02 13:38:54 +02:00
parent 03dbed963f
commit 9b72905458
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,7 @@ func Example_daemon() {
// Efficiently send a customized newsletter to a list of recipients. // Efficiently send a customized newsletter to a list of recipients.
func Example_newsletter() { func Example_newsletter() {
// The list of recipient. // The list of recipients.
var list []struct { var list []struct {
Name string Name string
Address string Address string
@ -91,6 +91,7 @@ func Example_newsletter() {
m.SetAddressHeader("To", r.Address, r.Name) m.SetAddressHeader("To", r.Address, r.Name)
m.SetHeader("Subject", "Newsletter #1") m.SetHeader("Subject", "Newsletter #1")
m.SetBody("text/html", fmt.Sprintf("Hello %s!", r.Name)) m.SetBody("text/html", fmt.Sprintf("Hello %s!", r.Name))
if err := gomail.Send(s, m); err != nil { if err := gomail.Send(s, m); err != nil {
log.Printf("Could not send email to %q: %v", r.Address, err) log.Printf("Could not send email to %q: %v", r.Address, err)
} }