Ai
1 Star 0 Fork 1

高鑫/Python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Send_Email.py 720 Bytes
一键复制 编辑 原始数据 按行查看 历史
randerson112358 提交于 2019-09-02 11:00 +08:00 . Update Send_Email.py
from smtplib import SMTP
#Use Google SMTP server
s = smtplib.SMTP('smtp.gmail.com', 587)
#s.ehlo()
# start TLS for security
s.starttls()
# Authentication
s.login("Email_Address@gmail.com", "Email_Password")
# message to be sent
message = "Message_you_need_to_send"
# sending the mail
s.sendmail("From_Address@gmail.com", "To_Address@gmail.com", message)
# terminating the session
s.quit()
#Resources:
# (1) How to send mail using Python:https://www.geeksforgeeks.org/send-mail-gmail-account-using-python/
# (2) Error Messages: https://stackoverflow.com/questions/26852128/smtpauthenticationerror-when-sending-mail-using-gmail-and-python
# (3) https://docs.python.org/3/library/smtplib.html
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaoxin1999/Python.git
git@gitee.com:gaoxin1999/Python.git
gaoxin1999
Python
Python
master

搜索帮助