#mail.py使用方法:
1,本脚本同目录下文件介绍:
sender.list:邮件发送者邮箱和密码,第一行账号(如example@example.com),第二行密码(必须项,不能为空)
receiver.list:邮件接收者列表,每行一个收件人(如example@example.com)
receivercc.list:邮件抄送者列表,每行一个收件人(如example@example.com)
调用方法举例1:
把发件人和收件人信息(sender.list和receiver.list)填好后,在mail.py所在目录执行
python mail.py -s sender.list -r receiver.list
2,其它帮助信息获得方法:
在mail.py所在目录执行:python mail.py -h
显示:
Options:
-h, –help show this help message and exit
-s SENDER, –sender=SENDER //配置本脚本发件人信息存放的文件的路径 如 /tmp/tmp/list.list
file for sender of the mail
-r RECEIVER, –receiver=RECEIVER //配置本脚本收件人列表存放的文件的路径 如 /tmp/tmp/list.list
list file for receivers of the mail
-p CC, –cc=CC list file for receivers of carbon copy //配置抄送收件人列表存放的文件的路径 如 /tmp/tmp/list.list
-t TITLE, –title=TITLE //配置邮件的标题,字符串(不能有空格)
title of the email,string
-c CONTENT, –content=CONTENT //配置邮件的内容,文件路径(和-i冲突时,-i参数无效)
content of the mail,must be a file
-a ATTACH, –attach=ATTACH //配置邮件的附件,文件路径(有附件时,必须配置-n参数)
attachment of the file
-n NAMEATTACH, –nameattach=NAMEATTACH //配置邮件的附件名称,字符串(不能有空格)(有附件时,必须配置本参数)
name for attachment of the file
-l SERVER, –server=SERVER //配置邮件的服务器,默认是smtp.163.com
log in to the server
-i INFO, –info=INFO information of the content,string,but not file //配置邮件的内容,字符串(不能有空格)(和-c冲突时,本参数无效)
-f FORM, –form=FORM form of the content,html or plain //配置邮件的内容的类型,默认是plain
调用方法举例2:
在mail.py所在目录执行:
python mail.py -s /root/t