标题: 有用过Ewomail的虎友吗?
时间: 2022-10-21
我搭建了Ewomail,也按照教程配置了ssl,但是我在python中发邮件,用465端口发不出去,用25端口却可以,但是在网易邮箱大师上面用465发邮件却可以,是不是我缺少了配置什么?
import smtplib
from email.mime.text import MIMEText
SMTPServer = "mail.xxxx.com"
sender = "xxx@xxxxx.com"
passwd = "xxxxxxxx"
message = "邮件内容"
msg = MIMEText(message)
msg["Subject"] = "邮件标题"
msg["From"] = sender
#端口
mailServer = smtplib.SMTP(SMTPServer, 465)
mailServer.login(sender, passwd)
mailServer.sendmail(sender, ["xxx@xxxx.com", "xxxx@xxxx.com"], msg.as_string())
mailServer.quit()
『回复列表(1|隐藏机器人聊天)』