From f5e5bbdc2c730b42ee0fbd7db6b08a0f29aa9330 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Thu, 27 Oct 2022 12:10:00 -0400 Subject: [PATCH] Updated the examples --- examples/examples.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/examples.go b/examples/examples.go index def5004..73b2471 100644 --- a/examples/examples.go +++ b/examples/examples.go @@ -4,6 +4,7 @@ Package main is examples using the go-mail package package main import ( + "context" "log" "os" "strconv" @@ -71,7 +72,7 @@ func awsSesExample() { email.Subject = "example go-mail email using AWS SES" // Send the email - if err = mail.SendEmail(email, provider); err != nil { + if err = mail.SendEmail(context.Background(), email, provider); err != nil { log.Fatalf("error in SendEmail: %s using provider: %x", err.Error(), provider) } log.Printf("email sent!") @@ -115,7 +116,7 @@ func mandrillExample() { email.Subject = "example go-mail email using Mandrill" // Send the email - if err = mail.SendEmail(email, provider); err != nil { + if err = mail.SendEmail(context.Background(), email, provider); err != nil { log.Fatalf("error in SendEmail: %s using provider: %x", err.Error(), provider) } log.Printf("email sent!") @@ -159,7 +160,7 @@ func postmarkExample() { email.Subject = "example go-mail email using Postmark" // Send the email - if err = mail.SendEmail(email, provider); err != nil { + if err = mail.SendEmail(context.Background(), email, provider); err != nil { log.Fatalf("error in SendEmail: %s using provider: %x", err.Error(), provider) } log.Printf("email sent!") @@ -212,7 +213,7 @@ func smtpExample() { email.Subject = "example go-mail email using SMTP" // Send the email - if err = mail.SendEmail(email, provider); err != nil { + if err = mail.SendEmail(context.Background(), email, provider); err != nil { log.Fatalf("error in SendEmail: %s using provider: %x", err.Error(), provider) } log.Printf("email sent!") @@ -279,7 +280,7 @@ func allOptionsExample() { } // Send the email (basic example using one provider) - if err = mail.SendEmail(email, provider); err != nil { + if err = mail.SendEmail(context.Background(), email, provider); err != nil { log.Fatalf("error in SendEmail: %s using provider: %x", err.Error(), provider) }