[Python] CentOS SMTP Communication Problem Resolution __python

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.