Sendmail Errno[61] Connection Refused

前端 未结 7 1113
不思量自难忘°
不思量自难忘° 2021-01-31 08:28

I\'ve been trying to get my application to mail some outputted text to an email. For simplification I have isolated the script :

import smtplib
import sys
import         


        
7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 08:40

    If you start a local server as follows:

    python -m smtpd -n -c DebuggingServer localhost:1025

    Make sure to modify the mail-sending code to use the non-standard port number:

    server = smtplib.SMTP(SERVER, 1025)
    server.sendmail(FROM, TO, message)
    server.quit()
    

提交回复
热议问题