Update smtp.py and fix the bug causing email sending failure under WSL2.

pull/21335/head
AuditAIH 11 months ago committed by GitHub
parent 9b25e9e735
commit 49a2eb20c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -22,11 +22,9 @@ class SMTPClient:
if self.use_tls: if self.use_tls:
if self.opportunistic_tls: if self.opportunistic_tls:
smtp = smtplib.SMTP(self.server, self.port, timeout=10) smtp = smtplib.SMTP(self.server, self.port, timeout=10)
# 发送EHLO命令并指定HELO域名为服务器地址
# Send EHLO command with the HELO domain name as the server address # Send EHLO command with the HELO domain name as the server address
smtp.ehlo(self.server) smtp.ehlo(self.server)
smtp.starttls() smtp.starttls()
# 重新发送EHLO命令以标识TLS会话
# Resend EHLO command to identify the TLS session # Resend EHLO command to identify the TLS session
smtp.ehlo(self.server) smtp.ehlo(self.server)
else: else:

Loading…
Cancel
Save