fix: Lower TLS version requirement for SMTP compatibility

pull/161/head
GolangBoy 2 years ago committed by 1379Monitor
parent 9f832fa3f9
commit 08b8030b5d

@ -109,7 +109,7 @@ func (e *emailServiceImpl) getEmailProperties(ctx context.Context) (emailPropert
func (e *emailServiceImpl) sendEmail(email *email.Email, properties emailProperties) error {
err := email.SendWithTLS(fmt.Sprintf("%s:%d", properties.Host, properties.SSLPort),
smtp.PlainAuth("", properties.Username, properties.Password, properties.Host), &tls.Config{ServerName: properties.Host, MinVersion: tls.VersionTLS13})
smtp.PlainAuth("", properties.Username, properties.Password, properties.Host), &tls.Config{ServerName: properties.Host, MinVersion: tls.VersionTLS12})
if err != nil {
return xerr.Email.Wrapf(err, "发送邮件错误 emailProperties=%v", properties).WithStatus(xerr.StatusInternalServerError).
WithMsg("发送邮件错误")

Loading…
Cancel
Save