Python for mail delivery

Source: Internet
Author: User
Tags server port

Sometimes it is necessary to use a script to send mail automatically, and Python to send the message is very convenient, the code is as follows:


#!/usr/bin/python#coding:utf-8import smtplib  from email.mime.text import  mimetext  #  introduction of Smtplib and mimetextsmtp_info = {"host": "Smtp.163.com", #  Set the outgoing server address "port": 25, #  set the outgoing server port number. Note that there are two forms of SSL and non-SSL "user": "[email protected]", #  set the outgoing mailbox "pass": "Password"  #  set the password of the sending mailbox} Mail_to_list=["[email protected]", "[email protected]"]mail_title= ' the first mail ' body  =  ' 


This article is from the "Small Fish Blog" blog, please be sure to keep this source http://395469372.blog.51cto.com/1150982/1731453

Python for mail delivery

Related Article

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.