pythone函数基础(14)发送邮件
导入yagmail模块
import yagmail
username='uitestp4p@163.com'
password='houyafan123'#生成授权码,qq、163、126都是授权码 mail_server = 'smtp.163.com'
# mail_server = 'smtp.qq.com'
# mail_server = 'smtp.126.com' m = yagmail.SMTP(user=username,password=password,host=mail_server)
# smtp_ssl=True,如果邮箱使用了安全协议,就需要加这个
#qq邮箱就是使用了安全协议 to = ['rer333@qq.com','3323@163.com','32323@qq.com']
cc = ['323233@qq.com','32323@qq.com','32323@qq.com'] m.send(to=to,cc=cc,subject='今天吃了吗',
contents='今天吃鱼肉了吗,吃饱没',
attachments=r'tools.py')
pythone函数基础(14)发送邮件的更多相关文章
- pythone函数基础(8)内置函数学习
内置函数学习# sorted# map# filter# max# sum# round# chr# ord# dir# bool# eval# exec# zipimport mathres = m ...
- pythone函数基础(15)接口开发初识
导入需要的第三方模块 import flaskimport toolsimport json,redisimport random server = flask.Flask(__name__)#新建一 ...
- pythone函数基础(13)发送网络请求
需要导入urllib模块,request模块发送网络请求有两种方法 第一种方法# from urllib.request import urlopen# from urllib.parse impor ...
- pythone函数基础(12)连接Redis,写数据,读数据,修改数据
需要导入Resdis模块 import redisip = '127.0.0.1'password='123456'r = redis.Redis(host=ip,password=password, ...
- pythone函数基础(11)读,写,修改EXCEL
#读EXCEL需要导入xlrd模块---在python控制台pip install xlrd模块import xlrdbook = xlrd.open_workbook('stu3.xls')shee ...
- pythone函数基础(10)MD5加密
导入hashlib模块import hashlibs='yulin123456's.encode()#把数字转换成bytes类型m=hashlib.md5(s.encode())print(m.hex ...
- pythone函数基础(9)操作数据库连接
#操作数据库连接import pymysqlconn = pymysql.connect(host='118.24.3.40',user='jxz', password='123456',port=3 ...
- pythone函数基础(7)第三方模块学习
一,time模块学习 import time # print(int(time.time()))#时间戳# res = time.strftime('%Y-%m-%d %H:%M:%S')#取当前格式 ...
- Python 函数基础、有序集合、文件操作(三)
一.set 特点: set是一个无序且不重复的元素集合访问速度快:天生解决元素重复问题 方法: 初始化 >>> s1 = set()>>> print(type(s ...
随机推荐
- 解决"Windows没有足够信息,不能验证该证书"问题
https://jingyan.baidu.com/article/335530dae0eb2319ca41c378.html
- jail-break-rule
switchOmega plugin for firefox and chrome https://raw.githubusercontent.com/gfwlist/gfwlist/master/g ...
- python pdfkit html转pdf响应式轮子 django例
pip install pdfkit 本例用django做的请求,换成对应框架即可 此方法可将html页面转成pdf下载 #!/usr/bin/env python # coding:utf-8 im ...
- Quick Search Articles in My Blog
=== Quickly Search Articles in My Blog: === 本文介绍了如何快速在主流搜索引擎搜索本专栏内文章的方法. Use Google's Search : pres ...
- An error occurred while starting the application.
一..net core 发布后的站点启动报错如下 An error occurred while starting the application. .NET Core 4.6.26328.01 X6 ...
- LeetCode 104. Maximum Depth of Binary Tree二叉树的最大深度 C++/Java
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the long ...
- jersey 用FastJson替换掉默认的Jackson
@Bean public ResourceConfig resourceConfig() { ResourceConfig resourceConfig = new ResourceConfig(); ...
- ubuntu安装后环境配置
首先实现能够连接外网,宿主机和虚拟机能ping通 进行smb的配置,能实现pytty的远程连接. 首先apt-get update 安装ssh apt-get install ssh 打开ssh服务 ...
- windows环境下安装rabbitmq及配置可视化管理界面
1.环境 windows7 64位 rabbitmq3.7.9 erlang10.22.先安装erlang,后安装rabbitmq.下载地址: rabbitmq http://www.rabbitmq ...
- 在引用阿里云库或其他库的时候,经常发生框架不兼容(原因是系统采用:Microsoft .NET Framework 4 Client Profile ),请改为Microsoft .NET Framework 4
在引用阿里云库或其他库的时候,经常发生框架不兼容(原因是系统采用:Microsoft .NET Framework 4 Client Profile ),请改为Microsoft .NET Frame ...