千家信息网

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

发表于:2024-10-12 作者:千家信息网编辑
千家信息网最后更新 2024年10月12日,windows命令行bat批处理脚本的应用之blat程序自动发邮件1.3windows命令行下使用blat发邮件带附件__游旗丶引莫(孙忠)发邮件脚本模板rem ----邮件内容-----set bo
千家信息网最后更新 2024年10月12日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%


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


优化加附件
-attach

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 -to [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%

0