The frist email to myself by python
昨天用python模块给自己发了第一封电子邮件,真是激动
今天完善了一下。
code:
import smtplib
from email.mime.text import MIMEText//email #包中加载部分功能
from email.header import Header sever = smtplib.SMTP_SSL()#加密传输
sever.connect('smtp.qq.com',465)#链接服务器 username =input('使用邮箱')
password =input('授权码')
to_addrs =['xxx.@qq.com']
sever.login(username,password) text='''
this is a good time!
my frist letters from python.
hope eveything.''' msg=MIMEText(text,'plain','utf-8')#发送文本内容
msg['From']=Header(username)
msg['To']=Header(",".join(to_addrs))
msg['Subject']=Header('welcom from python') try:
sever.sendmail(username,to_addrs,msg.as_string())
except:
print('发送失败,请重试') sever.quit()
The frist email to myself by python的更多相关文章
- Send Email in Robot Framework Python Using Gmail
转载自:http://seleniummaster.com/sitecontent/index.php/selenium-robot-framework-menu/selenium-robot-fra ...
- python操作email
python操作email 参考链接: python官网imaplib: https://docs.python.org/2/library/imaplib.html Python 用IMAP接收邮件 ...
- Python Email发送,通知业务完成
Email 发送 #!/usr/bin/python # -*- coding: UTF-8 -*- import base64 import smtplib from email.mime.text ...
- Python 3.4 send mail
#coding=utf-8 #Python 3.4 https://docs.python.org/3.4/library/ #IDE:Visual Studio 2015 Window10 impo ...
- 使用python发送和接收邮件
关于电子邮件 大学之前,基本不用邮箱,所以基本感觉不到它的存在,也不知道有什么用:然而大学之后,随着认识的人越来越多,知识越来越广泛,邮箱已然成为很重要的通讯工具,大学一些课程作业需要有邮箱发给老师, ...
- python基础第三天(1)
函数 函数分为:内置函数,自定义函数,导入函数. 内置函数 python为咱们提供的快捷方式 vars()---针对脚本的,找到这个脚本中的所有变量. #!/usr/bin/env python # ...
- Python基础之【第三篇】
dir(): 默认打印当前模块的所有属性,如果传一个对象参数则打印当前对象的变量名 vars() 默认打印当前模块的所有属性,如果传一个对象参数则打印当前对象的变量名和值 reload() 将以前导入 ...
- Python全栈之路3--set集合--三元运算--深浅拷贝--初识函数
一.上节课的重点回顾: 1.类名加括号其实就是执行类的__init__方法: 2.int a.创建方式 n1 = 123 #根据int类创建了一个对象 n2 = int(123) #根据int类创建一 ...
- 使用python发送QQ邮件
这里用到了Python的两个包来发送邮件: smtplib 和 email . Python 的 email 模块里包含了许多实用的邮件格式设置函数,可以用来创建邮件“包裹”.使用的 MIMEText ...
随机推荐
- python ftp批量上传文件下载文件
# encoding:utf-8 from ftplib import FTPimport osimport sys _XFER_FILE = 'FILE'_XFER_DIR = 'DIR' clas ...
- Java IO与网络编程笔记
<!doctype html>Java IO&NIO figure:first-child { margin-top: -20px; } #write ol, #write ul ...
- JavaScript之Map对象
前言 工欲善其事,必先利其器.这是一款以前在前端项目中没有使用过的.有趣的对象,咱来看看如何使用~ 并非arrayObj.map(function) //arrayObj.map与arrayObj.f ...
- eclipse搭建elastic-job
1.官网下载eclipse----面向Java EE企业级开发的Eclipse IDE for Java EE Developers:2.官网下载maven,并配置环境变量---MAVEN_HOME: ...
- Mvc Swagger报错的解决办法。
报错信息:Not supported by Swagger 2.0: Multiple operations with path ‘xxxx.aspx’ and method 'POST' 解决办法出 ...
- 使用Mac下的sequel Pro链接数据库时提示错误(已解决)
使用Mac下的sequel Pro链接数据库时,出现如下问题: ? 1 MySQL said: Authentication plugin 'caching_sha2_password' cannot ...
- 【转】Python多进程编程
[转]Python多进程编程 序. multiprocessingpython中的多线程其实并不是真正的多线程,如果想要充分地使用多核CPU的资源,在python中大部分情况需要使用多进程.Pytho ...
- Win 10 系统下研华采集卡Advantech Navi SDK虚拟demo设备安装方法
研华的DAQNavi是其采集卡设备的.net编程SDK,安装了其通讯工具Navigator后,可以添加虚拟采集卡 demo device. 在Win10上,执行添加操作时,可能会出现添加失败,这是由于 ...
- /usr/bin/ld: warning: libavformat.so.57, needed by /home/camera.so, not found (try using -rpath or -rpath-link)
ffmpeg中,使用libavformt.so.57时,查找不到. 解决方案: 修改ld.so.conf文件,添加路径. sudo gedit /etc/ld.so.conf 在文件末尾添加路径 /u ...
- 【easy】784. Letter Case Permutation
Examples: Input: S = "a1b2" Output: ["a1b2", "a1B2", "A1b2", ...