自动发送邮件工具-Auto Send Mail Tool (ASM)

ASM是一个自动发送HTML格式邮件的Python工具,由joyyzhang开发并托管在GitHub上。通过编写符合规定格式的`mail_content`,利用`writeAPI.py`中的API可以轻松修改邮件内容、发送列表等参数。核心文件`send_mail.py`封装了smtplib,用户只需关注邮件内容的编写,无需了解内部实现。

joyyzhang将源码已经放在了github上
https://github.com/zydirtyfish/asm.git
欢迎Fork!!!

joyyzhang为了能够实时监测服务器上程序的运行状态实现的一个自动发送email的程序。

首先看一下README.md
asm
Auto Send Mail Tool ( ASM )

This tool can help you to send emails in the form of HTML automatically. The only thing you need to do is to write the mail_content according to the format given in the source file. You can also modify this file by using the api given in writeAPI.py.

Start your “Hello world” mail by excuting sh auto_send.sh if you have create the mail_content metioned above.

send_mail.py
This is the kernel file by encapsulating smtplib. There is no need for you to know how it is realized, because you only need to modify the mail_content if you want to send mails automatically.

writeAPI.py
You can modify the mail_content much easier by using the api in this file.
- write_content(html) : To modify the mail_msg
- write_send_list(send_list) : To modify the send_list
- write_accessory_list(accessory_list) : To modify the accessory list
- write_img_list(img_list) : To modify the images contained in the main_msg
- write_all(content,subject,encoding,send_list,accessory_list,img_list) : To modify the parameters all above

mail_config
Always likes this.

[mail_config]
sender = XXXX@yyy.com It is your own email address
sender_name = your_name Your own name
password = **** Password of you email, always the smtp password
mail_host = smtp.yyy.com SMTP server domain. You can always find it on the Internet
mail_postfix = yyy.com

mail_content
Always likes this.

[mail_content]
send_list = XXXX@yyy.com who will receive this mail
subject = Pic Subject of this mail
encoding = utf-8 Encoding o
定时自动发送邮件服务使用说明 该软件运行环境需要.Net 3.5支持,Win7系统上可以直接运行. 主要功能可以定时自动发送邮件,发送程序做成服务形式,用户无需登录, 只要电脑是开启状态,就会自动执行发送邮件. 包含的文件, 1.AutoSendMail.exe --设置程序 2.AutoSendMail_Log.txt --存放日志的文本文件.自动生成 3.AutoSendMail_Setting.xml --配置文件 4.AutoSendMailService.exe --服务程序 5.InstallUtil.exe --微软的安装服务必须程序 6.tasks.mdb --Access数据库文件,用于存放邮箱内容. 可更改文件 7.安装服务.bat 8.使用说明.txt 9.卸载服务.bat 安装步骤: 第一步:安装服务 运行“安装服务.bat”文件。(需要管理员权限) 第二步:修改配置文件 修改好配置文件AutoSendMail_Setting.xml。确保Access数据库连接正确,每个任务的发送时点,和邮件信息。 每次修改配置文件必需重新启动服务才生效。 第三步:启动服务 a.从服务管理控制台启动服务,运行services.msc命令打开控制台。 b.通过设置程序启动服务。(需要管理员权限) 如果删除服务,则运行“卸载服务.bat”。 接口定义: 每个任务需要在指定的Access数据库里设置一个视图或表,用于存放邮件信息, 字段格式: 第一字段:ID 自动编号 第二字段:收件人 文本类型 第三字段:抄送人 文本类型 第四字段:主题 文本类型 第五字段:内容 备注类型 第六字段:发送次数 数字类型 备注:程序通过ID查找记录,来更新发送次数的值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值