pure_mail
¶
Bases: object
Source code in pure_ocean_breeze/mail/email.py
| Python | |
|---|---|
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
__init__(host, user, pwd, port=465)
¶
设置邮箱的账号和授权信息
Parameters¶
host : str
邮箱的服务器地址,如163邮箱的地址为smtp.163.com
user : str
邮箱账号,形如xxx@xxx.com
pwd : str
邮箱SMTP服务授权码,在邮箱设置中查看
port : int, optional
端口号, by default 465
Source code in pure_ocean_breeze/mail/email.py
| Python | |
|---|---|
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
sendemail(tolist, subject, body, lastemail_path=None)
¶
向指定邮箱账号发送带多个附件的邮件
Parameters¶
tolist : list
发送目标的账号,形如['xxx@xxx.com','yyy@yyy.com']
subject : str
邮件的主题
body : str
邮件的正文
lastemail_path : list
附件所在的地址,形如['/xxx/xxx/xxx.csv','/yyy/yyy/yyy.png']
Source code in pure_ocean_breeze/mail/email.py
| Python | |
|---|---|
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |