优化
This commit is contained in:
@@ -79,13 +79,6 @@ func (r *emailRepo) Send(ctx context.Context, to []string, subject, body string)
|
||||
return err
|
||||
}
|
||||
defer client.Close()
|
||||
if !config.IsSsl {
|
||||
if supported, _ := client.Extension("STARTTLS"); supported {
|
||||
if err = client.StartTLS(&tls.Config{ServerName: config.Host, MinVersion: tls.VersionTLS12}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
var auth smtp.Auth
|
||||
if config.IsLoginAuth {
|
||||
auth = &loginAuth{username: config.From, password: config.Secret}
|
||||
|
||||
Reference in New Issue
Block a user