mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
Update smtp.py (#21335)
This commit is contained in:
parent
0f5417ab84
commit
a098825fcc
@ -22,7 +22,11 @@ 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)
|
||||||
|
# Send EHLO command with the HELO domain name as the server address
|
||||||
|
smtp.ehlo(self.server)
|
||||||
smtp.starttls()
|
smtp.starttls()
|
||||||
|
# Resend EHLO command to identify the TLS session
|
||||||
|
smtp.ehlo(self.server)
|
||||||
else:
|
else:
|
||||||
smtp = smtplib.SMTP_SSL(self.server, self.port, timeout=10)
|
smtp = smtplib.SMTP_SSL(self.server, self.port, timeout=10)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user