From ef6b8aaa24585ca7fa3009dd71d9022b5ffa3448 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Mon, 10 Feb 2025 08:57:29 +0100 Subject: [PATCH] fix from address --- mailer.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mailer.go b/mailer.go index 007bdad..c0d90ed 100644 --- a/mailer.go +++ b/mailer.go @@ -78,6 +78,7 @@ func (m *Mailer) Send(emailcfg string, to string, data any, opts ...Option) erro dialOptions := []mail.Option{ mail.WithSMTPAuth(mail.SMTPAuthAutoDiscover), + mail.WithTLSPolicy(mail.TLSOpportunistic), // mail.WithSMTPAuth(mail.SMTPAuthNoAuth), mail.WithUsername(m.SMTPConfig.Username), mail.WithPassword(m.SMTPConfig.Password), @@ -114,13 +115,6 @@ func WithReplyTo(email string) Option { } } -func WithTLSOpportunistic() Option { - return func(m *mail.Msg, opts []mail.Option) ([]mail.Option, error) { - opts = append(opts, mail.WithTLSPolicy(mail.TLSOpportunistic)) - return opts, nil - } -} - func UnescapeHTML(s string) template.HTML { return template.HTML(s) }