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

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


发邮件脚本模板


rem ----邮件内容-----
set body="test mail"
rem ----邮件主题----
set s="测试test"
rem ----收件邮箱-----
set [email protected]
rem ----发件邮箱-----
set [email protected]
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 [email protected]
rem ----发件邮箱-----
set [email protected]
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 [email protected]
rem ----附件-----
set attach="1.txt"

rem ----发件邮箱-----
set [email protected]
rem ----邮箱秘钥-----
set pw=hacrtlypjdracada

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

猜你喜欢

转载自blog.51cto.com/mflag/2315592
今日推荐