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) }