Update smtp.py
Hello Reviewer,
I would like to submit this pull request for code review. The changes primarily aim to:
Resolve connection timeout issues ("Connection unexpectedly closed: timed out") by increasing the network timeout duration and optimizing SMTP connection retry logic.
Fix the "STARTTLS extension not supported by server" error by adding dynamic TLS/SSL protocol detection, which automatically falls back to non-encrypted connections when the server does not support STARTTLS.
Enhance error handling with more granular logging, allowing clearer identification of connection failures and authentication issues.
All modifications adhere to the project's coding standards and have been tested against common SMTP providers (e.g., Gmail, QQ Mail, Outlook) in a WSL2 environment to ensure compatibility.
Looking forward to your feedback!
Best regards
#解决WSL2下的邮件发送错误问题。
pull/21335/head
parent
9835730278
commit
9b25e9e735
Loading…
Reference in New Issue