标题: [原创] 用批处理+vbs做的邮件群发工具(高手请回毕) [打印本页]
作者: ab362425 时间: 2011-6-25 15:41 标题: 用批处理+vbs做的邮件群发工具(高手请回毕)
批处理+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)
复制代码
账号文本文件里面放你的收信邮箱一个一行。
作者: ab362425 时间: 2011-6-25 16:01
后面在加点东西算了要实现取文本总行数如下
setlocal Enabledelayedexpansion
call :G_getrows 账号.txt kk
echo %kk%
用这个方法可以代替上面的2
作者: Demon 时间: 2011-6-29 11:49
为什么不直接用VBS
作者: ab362425 时间: 2011-6-29 11:49
我的VBS不是很好
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |