CentOS failed to send mail without any error message
A mail sending program written in Python runs successfully on the local computer windows10 and python 3.10.0, but fails to run on Alibaba cloud server CentOS 7.6 and python 3.6.8, and there is no error message (it may also timeout, but I am not patient to wait for the error result).
Solution:
Previous code:
1 #163 email 2 mail_host = 'smtp.163.com' 3 smtpObj = smtplib.SMTP() 4 smtpObj.connect(mail_host,25) 5 6 # or 7 mail_host = 'smtp.163.com' 8 smtpObj = smtplib.SMTP(mail_host, 25)
After modification:
#163 email mail_host = 'smtp.163.com' smtpObj = smtplib.SMTP() smtpObj.connect(mail_host,25) or: mail_host = 'smtp.163.com' smtpObj = smtplib.SMTP_SSL(mail_host, 463)
Attachment: centos7 uses Python STMP to send mail without sending or error prompt
Similar Posts:
- [Solved] smtplib Sent Email Error: SMTPDataError: (554, ‘DT:SPM 163 smtp1
- [773]smtplib.SMTPServerDisconnected: Connection unexpectedly closed
- Error: need RCPT command
- Python Send Email Error: smtplib.SMTPException: SMTP AUTH extension not supported by server
- How to Solve Name Error: module ‘yagmail’ has no attribute ‘SMTP’
- Phpmailer’s solution to extension missing: OpenSSL error
- [mailbox usage] POP3, SMTP activation and setting method of Yahoo mailbox
- javax.mail.MessagingException: Could not convert socket to TLS
- javax.net.ssl.SSLHandshakeException: No appropriate protocol [How to Solve]
- JavaMail uses 163 mailbox to report 535 error: authentication failed