Recently learned the next Smtplib module, and then I wrote a message to send the code, running under Windows is no problem, but put on the server running, but has not been running.
At first it was written:
But it's been stuck here since the run:
The process in the background also has:
Then go to Baidu, tried a lot of ways, and finally resolved, the solution is as follows:
I modified the source code to the following format:
Then we run it again, and we can see that it has been run successfully:
At this time the mailbox reminder also came:
The problem occurs because of the following:
Emmm, the reason is very pit ...
First of all, my server is Aliyun, this is Aliyun instructions for using SMTP
First, the Aliyun disables port 25, so it is not available at first, and later converted to SSL encryption, use port No. 465 for help.
Summarize:
There are some inexplicable mistakes in the future, you can see the help first.