当前位置:首页 > 操作系统 > Windows

1.3windows命令行下使用blat发邮件带附件

windows命令行bat批处理脚本的应用之blat程序自动发邮件
1.3windows命令行下使用blat发邮件带附件
__游旗丶引莫(孙忠)

发邮件脚本模板


rem ----邮件内容-----
set body="test mail"
rem ----邮件主题----
set s="测试test"
rem ----收件邮箱-----
set t=nn1183@qq.com
rem ----发件邮箱-----
set f=442624872@qq.com
rem ----邮箱秘钥-----
set pw=hacrtlypjdracada
rem ----执行发送-----
Blat -body %body% -s %s% -t %t% -server smtp.qq.com -f %f% -u %f% -pw %pw%


http://blog.51cto.com/mflag/2283256


优化加附件
-attach <file>

rem ----邮件内容-----
set body="test mail"
rem ----邮件主题----
set s="测试test"
rem ----收件邮箱-----
set t=nn1183@qq.com
rem ----发件邮箱-----
set f=442624872@qq.com
rem ----邮箱秘钥-----
set pw=hacrtlypjdracada

rem ----附件-----
set attach="1.txt,1.7z"

rem ----执行发送-----
Blat -body %body% -s %s% -attach %attach% -t %t% -server smtp.qq.com -f %f% -u %f% -pw %pw%


优化文件内容从文件中取
Blat <filename> -to <recipient> [optional switches (see below)]

rem ----邮件内容-----
set body="1.txt"
rem ----邮件主题----
set s="测试test"
rem ----收件邮箱-----
set t=nn1183@qq.com
rem ----附件-----
set attach="1.txt"

rem ----发件邮箱-----
set f=442624872@qq.com
rem ----邮箱秘钥-----
set pw=hacrtlypjdracada

rem ----执行发送-----
Blat %body% -s %s% -attach %attach% -t %t% -server smtp.qq.com -f %f% -u %f% -pw %pw%

原文:http://blog.51cto.com/mflag/2315592


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐