批处理+VBS实现的邮件群发器
1.批处理+VBS实现+文本内容实现邮件群发。- @echo off
- title 刚做好的邮箱群发工具&color da
- ::这里用到了G_getrows 还显视文本总行kk在把变量符应用到下面中去了,
- set l=1
- for /f %%u in (内容.txt) do set nl=%%u &&for /f %%j in (标题.txt) do set bt=%%j
- setlocal Enabledelayedexpansion
- call :G_getrows 账号.txt kk
- set ii=%kk%
- :in
- if %l% gtr %ii% exit
- for %%a in (%l%) do (
- call :lp %%a
- )
- :lp
- for /f "tokens=1,* delims=:." %%i in ('findstr/n .* 账号.txt') do (
- if %%i equ %1 set i=%%j)
- echo NameSpace = "http://schemas.microsoft.com/cdo/configuration/" >>a.vbs
- echo Set Email = CreateObject("CDO.Message") >>a.vbs
- echo Email.From = "%账号全名%" >>a.vbs ||::发送邮件全名
- echo Email.To = "%i%" >>a.vbs
- echo Email.Subject = "%bt%" >>a.vbs ||::这里是标题
- echo Email.Htmlbody = "%nl%" >>a.vbs ||::这里是内容
- echo With Email.Configuration.Fields >>a.vbs
- echo .Item(NameSpace^&"sendusing") = 2 >>a.vbs
- echo .Item(NameSpace^&"smtpserver") = "%邮箱类型%" >>a.vbs
- echo .Item(NameSpace^&"smtpserverport") = 25 >>a.vbs
- echo .Item(NameSpace^&"smtpauthenticate") = 1 >>a.vbs
- echo .Item(NameSpace^&"sendusername") = "%账号名%" >>a.vbs
- echo .Item(NameSpace^&"sendpassword") = "%密码%" >>a.vbs
- echo .update >>a.vbs
- echo End With >>a.vbs
- echo Email.Send >>a.vbs
- a.vbs
- ping 127.1 -n 2 >nul
- del a.vbs
- set/a l+=1
- goto in
- :G_getrows
- set %2=0
- for /f %%i in ('findstr /n .* %1') do (set /a %2=%2+1)
复制代码 账号文本文件里面放你的收信邮箱一个一行。 |