标题: [网络工具] 命令行发送邮件(群发、多附件、匿名)p-mailsend_4.0 [打印本页]
作者: HAT 时间: 2009-9-20 11:46 标题: 命令行发送邮件(群发、多附件、匿名)p-mailsend_4.0
- ::p-mailsend.cmd
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: p-mailsend_v4.0 ::
- :: ::
- :: Code by : vkill ::
- :: Thanks : bjsh,est,lxmxm... ::
- :: 出 处 : http://www.vkill.net http://bbs.cn-dos.net ::
- :: 功 能 : 命令行邮件发送程序(群发\多附件\匿名) ::
- :: 原 理 : telnet收发邮件的原理 ::
- :: 最后更新 : 2007-11-12 ::
- :: 程序依赖文件:nc.exe;rar.exe;base64.exe ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- @echo off&endlocal&setlocal ENABLEDELAYEDEXPANSION
- set "t_=test.conf"
- ::这里是匿名发信的详细设置
- set "匿名="QQ邮箱管理员匿名测试" ^<10000@qq.com^>"
-
- call :del_
- set "oneself=%~f0"
- if "%1"=="" (
- echo 请在命令行下执行 %oneself% /? 查看详细命令行帮助
- ping -n 5 127.1 >nul 2>nul
- goto :eof
- )
- if "%1"=="/?" goto help
- if "%1"=="-?" goto help
- for %%? in (/h,-h,--h) do (if "%~1"=="%%?" goto help)
- echo.
- echo p-mailsend_v4.0 by:vkill
- echo _________________________________________________
-
- set/p=依赖文件完整性检查...<nul
- set "tools_name=nc.exe;rar.exe;base64.exe"
- for %%? in (%tools_name%) do (
- if *%%~$PATH:?==* if not exist %%? (
- echo no,缺失文件%%? &goto :sleep_
- )
- )
- set/p=ok<nul&echo.
-
- set/p=分析参数是否正确...<nul
- set n=0
- if not "%1"=="" (
- :loop_ap
- set/a n+=1
- if "%1"=="/hu" (set "hu=on" &shift)
- if "%1"=="/ht" (set "ht=on" &shift)
- if "%1"=="/ch" (set "ch=on" &shift)
- if "%1"=="/u" ((for /f "tokens=1-2 delims=@" %%a in ('echo %~2') do (set "user=%%a"& set "server=%%b")) &shift&shift)
- if "%1"=="/p" (set "pass=%~2" &shift&shift)
- if "%1"=="/t" (set "to=%~2" &shift&shift)
- if "%1"=="/s" (set "subject=%~2" &shift&shift)
- if "%1"=="/c" (set "content=%~2" &shift&shift)
- if "%1"=="/a" (set "accessories=%~2" &shift&shift)
- if not "%1"=="" (echo %~1|findstr "^/" >nul 2>nul ||(echo no,参数"%~1"错误&goto :sleep_))
- if !n!==10 (echo no,参数"%~1"错误&goto :sleep_)
- if not "%1"=="" (goto loop_ap)
- )
- set/p=ok<nul&echo.
-
- set/p=分析必须参数是否缺失...<nul
- for %%? in (user server to subject) do (if not defined %%? (echo no&goto :sleep_))
- set/p=ok<nul&echo.
- if not defined pass (
- :inputpass
- for /f "tokens=1 delims=:" %%? in ('findstr /N "=Hiddenpass.cmd_s=" "%oneself%"') do (more +%%? %oneself%>"%temp%\a")
- for /f "tokens=1 delims=:" %%? in ('findstr /N "=Hiddenpass.cmd_e=" "%oneself%"') do (set/a "a=%%?-1" & more +!a! %oneself%>"%temp%\b")
- findstr /V /B /E /G:"%temp%\b" "%temp%\a">"%temp%\pass.cmd"
- start /wait cmd /k ""%temp%\pass.cmd" "!user!@!server!""
- set/p password=<%temp%\pass
- set "pass=!password:~9!"
- if not defined pass goto inputpass
- del /f/q "%temp%\pass" >nul 2>nul
- del /f/q "%temp%\pass.cmd" >nul 2>nul
- del /f/q "%temp%\a" >nul 2>nul
- del /f/q "%temp%\b" >nul 2>nul
- )
-
- set/p=验证支持这个地址的邮箱发信否...<nul
- for /f "tokens=3-6 delims=," %%a in ('findstr "^::,%server%," "%oneself%"') do (
- set "smtp=%%a"&set "port=%%b"&set "认证方式=%%c"&set "max_z=%%d"
- )
- if not defined smtp (echo no&goto :sleep_)
- set/p=ok<nul&echo.
-
- set/p=验证网络通否...<nul
- for /f "tokens=2 delims=[]" %%? in ('ping -n 1 %smtp% ^|findstr /i "^ping.*[.*]"') do (set "ip=%%?")
- if not defined ip (echo no&goto :sleep_)
- set/p=ok<nul&echo.
-
- set/p=验证telnet %smtp% %port%通否...<nul
- >"%temp%\l%t_%" echo quit
- nc -d -nvv %ip% %port% < "%temp%\l%t_%" >"%temp%\p-mailsend.log"
- findstr . "%temp%\p-mailsend.log">nul 2>nul||(echo no&goto :sleep_)
- set/p=ok<nul&echo.
-
- set/p=验证登陆成功否...<nul
- if "%认证方式%"=="1" call :认证方式1
- copy "%temp%\%t_%" "%temp%\l%t_%">nul 2>nul
- >>"%temp%\l%t_%" echo quit
- nc -d -nvv %ip% %port% < "%temp%\l%t_%" >"%temp%\p-mailsend.log"
- set n=0
- for /f "tokens=1,2* delims=:" %%a in ('findstr /N . "%temp%\p-mailsend.log"') do (set "n=%%a"&set "x%%a=%%b")
- set/a n-=1
- echo "!x%n%!"|findstr "235 " >nul 2>nul ||(echo no,错误"!x%n%!"&goto :sleep_)
- set/p=ok<nul&echo.
-
- ::继续写nc配置文件
- >>"%temp%\%t_%" echo mail from: ^<%user%@%server%^>
- if exist "%to%" (
- for /f "tokens=*" %%? in ('findstr "^[0-9a-zA-Z-_.]@" "!to!"') do (set "lto=%%?,!lto!")
- )
- if defined lto (set "to=!lto!")
- for %%? in (!to!) do (>>"%temp%\%t_%" echo rcpt to: ^<%%?^>)
- >>"%temp%\%t_%" echo data
- if not defined hu (>>"%temp%\%t_%" echo From: %user%@%server%) else (>>"%temp%\%t_%" echo From: %匿名%)
- if not defined ht (>>"%temp%\%t_%" echo To: %to%)
- >>"%temp%\%t_%" echo Subject: %subject%
- >>"%temp%\%t_%" echo X-mailer: p-mailsend_v4.0 [cn]
- >>"%temp%\%t_%" echo Mime-Version: 1.0
- >>"%temp%\%t_%" echo Content-Type: multipart/mixed;
- >>"%temp%\%t_%" echo boundary="=====vkill====="
- >>"%temp%\%t_%" echo.
- >>"%temp%\%t_%" echo --=====vkill=====
- if defined content call :htmlortxt !content!
- >>"%temp%\%t_%" echo charset="gb2312"
- >>"%temp%\%t_%" echo Content-Transfer-Encoding: 7bit
- >>"%temp%\%t_%" echo.
- if defined content (dir !content! >nul 2>nul &&(type "!content!">>"%temp%\%t_%" &>>"%temp%\%t_%" echo.) ||(>>"%temp%\%t_%" echo !content!)) else (>>"%temp%\%t_%" echo :^))
-
- set z=0
- if defined accessories set/p=压缩编码附件中...<nul
- echo "%accessories%" |findstr ")" >nul 2>nul && (echo no,附件路径或文件名中不能包含^)&goto :sleep_)
- if defined accessories (
- for /f "tokens=1,2,3,4,5,6 delims=→" %%a in ('echo %accessories%') do (
- call :压缩编码附件 "%%~a"
- call :压缩编码附件 "%%~b"
- call :压缩编码附件 "%%~c"
- call :压缩编码附件 "%%~d"
- call :压缩编码附件 "%%~e"
- call :压缩编码附件 "%%~f" )
- )
- if defined xx (echo no,压缩或编码附件错误&goto :sleep_)
- if not !z! lss %max_z% (echo 附件过大,%server%邮箱最大支持附件大小为%max_z%K&goto :sleep_)
- if defined accessories (set/p=ok<nul&echo.)
- >>"%temp%\%t_%" echo --=====vkill=====--
- >>"%temp%\%t_%" echo .
- >>"%temp%\%t_%" echo quit
-
- ::发信
- set/p=发信中...<nul
- nc -d -nvv %ip% %port% < ""%temp%\%t_%"" >"%temp%\p-mailsend.log"
- for /f "tokens=*" %%? in ("%temp%\p-mailsend.log") do (
- if defined vk1 if not defined vk2 (set vk2=0&set "发信错误=%%?"&echo "%%?"|findstr "250 " >nul 2>nul ||(set vk3=0))
- echo "%%?"|findstr "354 " >nul 2>nul &&(set vk1=0)
- )
- if defined vk3 (echo no,错误"!发信错误!"&goto :sleep_)
- set/p=ok<nul&echo.
-
- call :del_
- echo _________________________________________________
- echo 信件发送完成,2秒后退出
- ping -n 2 127.1 >nul 2>nul
- goto :eof
-
- ::all call::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- :help
- echo.
- echo p-mailsend_v4.0 2007.11 by:vkill Thanks to bjsh,est,lxmxm...
- echo Copyright (C) 2006-2008 http://www.vkill.net http://bbs.cn-dos.net
- echo 当前支持的邮箱有:21cn.com,sina.com,163.com,126.com,sohu.com,yahoo.com.cn,qq.com
- echo 程序依赖文件:nc.exe;rar.exe;base64.exe
- echo 如依赖文件不全请手动到http://www.vkill.net/tools.html上下载到windows目录
- echo.
- echo Usage:
- echo p-mailsend [/hu] [/ht] /u 用户@地址 [/p 密码] /t 收件人 /s 主题 [/c 内容] [/ch] [/a 附件]
- echo.
- echo /hu 匿名发信
- echo /ht 隐藏多方发送时别的收件人
- echo /u * 用户名@地址 例:/u 122755990@qq.com
- echo /p 密码
- echo /t * 收件人:(收件人/写好收件人列表的文本文件路径)
- echo (多收件人用,隔开;用""引住) 例:/t "abc@163.com,123@56.com"
- echo (收件人列表的文本文件格式如下:)
- echo a@163.com
- echo b@163.com
- echo c@163.com
- echo /s * 主题
- echo /c 内容:(文字/写好内容的文本文件路径)
- echo /ch 信件内容html格式开关,表示发送的内容为html格式
- echo /a 附件:(绝对/相对路径,多附件用→隔开用""引住) 例:/a "c:\a b.cmd→1234.txt"
- goto :eof
-
- :认证方式1
- >>"%temp%\%t_%" echo helo vkill
- >>"%temp%\%t_%" echo auth login
- for %%? in (%user%;%pass%) do (
- set/p=%%?^<nul|base64>"l!t_!"
- set/p v=<"l!t_!"
- >>"%temp%\%t_%" echo !v!
- del /f/q "l!t_!"
- )
- goto :eof
-
- :del_
- del /f/q "%temp%\%t_%">nul 2>nul
- del /f/q "%temp%\l%t_%">nul 2>nul
- del /f/q "%temp%\p-mailsend.log">nul 2>nul
- goto :eof
-
- :htmlortxt
- if "%ch%"=="on" (>>"%temp%\%t_%" echo Content-Type: text/html;) else (>>"%temp%\%t_%" echo Content-Type: text/plain;)
- goto :eof
-
- :压缩编码附件
- if "%~1"=="" exit/b
- if "%~x1"==".rar" (copy "%~1" "%temp%\%~n1_.rar" >nul 2>nul) else (
- dir %~1 >nul 2>nul &&(rar.exe -r a "%temp%\%~n1_.rar" "%~1" >nul 2>nul)||(rar.exe a "%temp%\%~n1_.rar" "%~1" >nul 2>nul)
- )
- if not exist "%temp%\%~n1_.rar" (set xx=vkill&exit/b)
- for %%? in ("%temp%\%~n1_.rar") do (set/a z=z+%%~z?)
- >>"%temp%\%t_%" echo --=====vkill=====
- >>"%temp%\%t_%" echo Content-Type: application/octet-stream;
- >>"%temp%\%t_%" echo name="%~n1_.rar"
- >>"%temp%\%t_%" echo Content-Transfer-Encoding: base64
- >>"%temp%\%t_%" echo Content-Disposition: attachment;
- >>"%temp%\%t_%" echo filename="%~n1_.rar"
- >>"%temp%\%t_%" echo.
- base64.exe -i "%temp%\%~n1_.rar">>"%temp%\%t_%"
- >>"%temp%\%t_%" echo.
- del /f/q "%temp%\%~n1_.rar" >nul 2>nul
- goto :eof
-
- :sleep_
- call :del_
- ping -n 2 127.1 >nul 2>nul
- goto :eof
-
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- =Hiddenpass.cmd_s=
- @echo off
- chcp 437>nul&graftabl 936>nul
- echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5x>in.com
- echo (注:输入密码时不明文显示)
- set /p password=请输入mail:%~1的密码:<nul
- for /f "tokens=*" %%i in ('in.com') do set password=%%i
- del in.com
- echo.
- >%temp%\pass set password
- exit
- =Hiddenpass.cmd_e=
-
- :::::::::::::::::::::当前支持的地址::::::::::::::::::::::
- ::,邮箱地址,smtp地址,telnet smtp端口,认证方式,最大附件大小(k)
- ::,21cn.com,smtp.21cn.com,25,1,15000000
- ::,sina.com,smtp.sina.com.cn,25,1,15000000
- ::,163.com,smtp.163.com,25,1,20000000
- ::,126.com,smtp.126.com,25,1,20000000
- ::,sohu.com,smtp.sohu.com,25,1,10000000
- ::,yahoo.com.cn,smtp.mail.yahoo.com,25,1,15000000
- ::,yahoo.com,smtp.mail.yahoo.com,25,1,15000000
- ::,qq.com,smtp.qq.com,25,1,5000000
- ::
复制代码
群发方法:
p-mailsend /u *@* /p * /t a.txt /s test /c * /a *
a.txt格式如下:
a@163.com
b@qq.com
c@56.com
d@yahoo.com.cn
....
本地下载:
http://pan.baidu.com/share/link?shareid=3811808911&uk=1124163200
转自:http://www.cn-dos.net/forum/viewthread.php?tid=29873
作者: HAT 时间: 2009-9-20 11:52 标题: 简单注释
- @echo off&setlocal ENABLEDELAYEDEXPANSION
- set "t_=test.conf"
- set "server=163.com"
- set "port=25"
- set "最大附件大小=15000000"
- set "tools_url=http://www.vkill.net/netbar/网吧所需exe/"
- set "tools_name=nc.exe;rar.exe;base64.exe"
- rem ================检查文件完整性=====================
- :down_tools
- set "down_ok=y"
- if not "%tools_name%*"=="*" (
- for %%? in (%tools_name%) do (
- if *%%~$PATH:?==* if not exist %%? (
- set "down_ok=n"
- echo 程序所依赖文件%%?缺失,已自动开始下载
- if not exist iget.vbs call :iget.vbs_
- iget.vbs "%tools_url%%%?" "%%?"
- ::move "%%?" %windir%>nul 2>nul
- echo 文件%%?下载完毕
- )
- )
- )
- del /f/q iget.vbs>nul 2>nul
- if [%down_ok%]==[n] goto down_tools
- rem ==================结束==============================
- rem ===============分析参数=============================
- for %%? in (/? -? /h -h --h) do (if "%1"=="%%?" goto help)
- if "%1"=="" goto help
- :loop_ap
- set/a n+=1
- if not "%1"=="" (
- if "%1"=="/x" goto 交互模式
- if "%1"=="/u" set "user=%~2"
- if "%1"=="/p" set "pass=%~2"
- if "%1"=="/t" set "to=%~2"
- if "%1"=="/s" set "subject=%~2"
- if "%1"=="/c" set "content=%~2"
- if "%1"=="/a" set "accessories=%~2"
- shift&shift
- goto loop_ap
- )
- for %%? in (user pass to subject) do (if not defined %%? goto 参数错误)
- goto start
- rem ===================结束===============================
- :交互模式
- call :help vkill
- if not defined user (set/p "user=用户名: ")
- if not defined pass (set/p "pass=密码: ")
- if not defined to (set/p "to=收件人: ")
- if not defined subject (set/p "subject=主题<hello>: ")
- if not defined content (set/p "content=内容: ")
- if not defined accessories (set/p "accessories=附件: ")
- rem :::::开始写配置文件:::::
- :start
- ::写单个发送配置文件
- for /l %%? in (1,1,7) do (>%%? cd.)
- >>1 echo helo vkill
- >>1 echo AUTH LOGIN
- rem ===================1文件的内容==========================
- rem helo vkill
- rem AUTH LOGIN
- rem ====================结束================================
- for %%? in (%user%;%pass%) do (
- set/p=%%?^<nul|base64>"!t_!"
- set/p v=<"!t_!"
- >>2 echo !v!
- del /f/q !t_!
- )
- rem [*第一次改写 test.conf 做为一个中介用来把用户名密码的base64编码写入文件2*]
- rem =================2文件的内容=============================
- rem 用户名和密码的base64编码
- rem =====================结束================================
- rem [*改写test.conf利用nc 灌入服务器25端口的回显判断是否能够成功登陆*]
- >8 echo quit
- rem =================8文件的内容============================
- rem quit
- rem ====================结束================================
- copy 1+2+8 "!t_!" >nul 2>nul
- rem ::判断能否登陆::
- rem 第二次改写test.conf 以用来 验证能否登陆服务器 nc -nvv IP Port <test.conf
- rem =================test.conf文件的内容=====================
- rem helo vkill
- rem AUTH LOGIN
- rem 用户名base64编码
- rem 密码base64编码
- rem quit
- rem ====================结束================================
- call :发信程序
- cls
- call :判断登陆成功否
- if errorlevel 1 goto :del_
- rem ::判断结束::
- >>3 echo mail from: ^<%user%@%server%^>
- rem ===================3文件的内容=============================
- rem mail from: <%user%@163.com>
- rem =======================结束================================
-
- >>5 echo data
- >>5 echo From: %user%@%server%
- >>5 echo To: %to%
- >>5 echo Subject: %subject%
- >>5 echo X-mailer: p-163ms 2.0 [cn]
- >>5 echo Mime-Version: 1.0
- >>5 echo Content-Type: multipart/mixed;
- >>5 echo boundary="=====vkill====="
- >>5 echo.
- if defined content (
- >>5 echo --=====vkill=====
- >>5 echo Content-Type: text/plain;
- >>5 echo charset="gb2312"
- >>5 echo Content-Transfer-Encoding: 7bit
- >>5 echo.
- dir !content! >nul 2>nul &&(type "!content!">>5) ||(>>5 echo !content!)
- )
- rem ====================5文件的内容=============================
- rem data
- rem From: %user%@163.com
- rem To: %to%
- rem Subject: %subject%
- rem X-mailer: p-163ms 2.0 [cn]
- rem Mime-Version: 1.0
- rem Content-Type: multipart/mixed;
- rem boundary="=====vkill====="
- rem 如果有内容的话
- rem --=====vkill=====
- rem Content-Type: text/plain;
- rem charset="gb2312"
- rem Content-Transfer-Encoding: 7bit
- rem
- rem 内容
- rem ======================结束================================
- echo 压缩编码文件中...
- if defined accessories for %%? in (%accessories%) do (call :压缩编码附件 "%%?")
- >>7 echo --=====vkill=====--
- >>7 echo .
- >>7 echo quit
- rem ===================7文件的内容============================
- rem --=====vkill=====--
- rem
- rem quit
- rem ======================结束================================
- ::发信
- for %%? in (%to%) do (
- echo 给%%?发信中...
- ::合并单个发送配置文件
- >4 echo rcpt to: ^<%%?^>
- del /f/q "!t_!"
- copy 1+2+3+4+5+6+7 "!t_!" >nul 2>nul
- call :发信程序
- call :判断发送成功否
- )
- rem ====================4文件的内容=============================
- rem rcpt to:<%to%>
- rem =======================结束================================
- rem 第三次改写 test.conf文件.合并1-7个文件;内容如下;也是最关键的东西.
- rem ===================test.conf文件的内容==========================
- rem helo vkill
- rem AUTH LOGIN
- rem 用户名base64编码
- rem 密码base64编码
- rem mail from: <%user%@163.com>
- rem rcpt to: <%to%@163.com>
- rem data
- rem From: %user%@163.com
- rem To: %to%@163.com
- rem Subject: %subject%
- rem X-mailer: p-163ms 2.0 [cn]
- rem Mime-Version: 1.0
- rem Content-Type: multipart/mixed;
- rem boundary="=====vkill====="
- rem
- rem --=====vkill=====
- rem Content-Type: text/plain;
- rem charset="gb2312"
- rem Content-Transfer-Encoding: 7bit
- rem
- rem %content%
- rem --=====vkill=====
- rem Content-Type: application/octet-stream;
- rem name="附件名称_.rar"
- rem Content-Transfer-Encoding: base64
- rem Content-Disposition: attachment;
- rem filename="附件名称_.rar"
- rem
- rem 附件压缩文件的base64编码
- rem
- rem --=====vkill=====--
- rem .
- rem quit
- rem ====================结束================================
- rem ::::写配置文件结束::::
- cls
- if errorlevel 1 echo 发信不成功 & goto del_
- call :del_
- echo 全部信件发送完毕
- ping -n 3 127.1>nul 2>nul
- goto :eof
- :del_
- for /l %%? in (1,1,8) do (del /f/q %%?>nul 2>nul)
- del /f/q "%t_%">nul 2>nul
- del /f/q p-163ms.log>nul 2>nul
- goto :eof
- :help
- if "%1"=="vkill" goto :eof
- echo ____help________________________________________________________________________
- echo.
- echo p-163ms v2.0 by:vkill
- echo Copyright (C) 2006-2008 http://www.vkill.net
- echo.
- echo Usage: p-163ms.cmd [/x] /u 用户名 /p 密码 /t 收件人 /s 主题 [/c 内容] [/a 附件]
- echo.
- echo /x 交互模式,当使用此参数时别的参数全部无效
- echo /t 收件人:(多收件人中间用,隔开;多附件时用""引住)
- echo /c 内容:(文字/写好内容的文本文件路径)
- echo /a 附件:(绝对路径/相对路径,多附件中间用,隔开;多附件时用""引住)
- echo.
- echo 示例:
- echo p-163ms.cmd /u 123 /p abc /t "122755990@qq.com" /s hello
- echo p-163ms.cmd /u 123 /p abc /t "122755990@qq.com" /s hello /c 123 /a "d:\00.txt"
- echo p-163ms.cmd /u 123 /p abc /t "122755990@qq.com,yx127@yx127.com" /s hello /c 123 /a "d:\00.txt,c:\00.bat"
- echo.
- echo ________________________________________________________________________________
- goto :eof
- :压缩编码附件
- dir %~1 >nul 2>nul &&(call :压缩文件 "%~1" "rar.exe -r")||(call :压缩文件 "%~1" rar.exe)
- call :判断文件大小 "%~n1_.rar"
- >>6 echo --=====vkill=====
- >>6 echo Content-Type: application/octet-stream;
- >>6 echo name="%~n1_.rar"
- >>6 echo Content-Transfer-Encoding: base64
- >>6 echo Content-Disposition: attachment;
- >>6 echo filename="%~n1_.rar"
- >>6 echo.
- base64.exe -i "%~n1_.rar">>6
- >>6 echo.
- del /f/q "%~n1_.rar" >nul 2>nul
- goto :eof
- rem ==================6文件的内容===================================
- rem --=====vkill=====
- rem Content-Type: application/octet-stream;
- rem name="%~n1_.rar"
- rem Content-Transfer-Encoding: base64
- rem Content-Disposition: attachment;
- rem filename="%~n1_.rar"
- rem
- rem 附件的base64编码
- rem
- rem ====================结束======================================
- :压缩文件
- %~2 a "%~n1_.rar" "%~1" >nul 2>nul||(goto 压缩文件错误)
- goto :eof
- :判断文件大小
- set/a z+=%~z1
- ::判断附件大小
- if not !z! lss %最大附件大小% (goto 附件大小超出)
- goto :eof
- :发信程序
- for /f "tokens=2 delims=[]" %%? in ('ping -n 1 smtp.163.com ^|findstr /i "^Ping"') do (set "ip=%%?")
- nc -nvv !ip! %port%<"!t_!">p-163ms.log
- goto :eof
- :判断登陆成功否
- for /f "tokens=1-2 delims=:" %%a in ('findstr /N . p-163ms.log') do (set "%%a=%%b")
- echo !5!|findstr "^235" >nul 2>nul ||(goto 登陆不成功)
- goto :eof
- :判断发送成功否
- for /f "tokens=1-2 delims=:" %%a in ('findstr /N . p-163ms.log') do (set "%%a=%%b")
- if not defined 10 (call :发信不成功)
- echo !9!|findstr "^250" >nul 2>nul ||(goto 发信不成功)
- goto :eof
- :iget.vbs_
- >iget.vbs echo x=LCase(WScript.Arguments(1))
- >>iget.vbs echo y=LCase(WScript.Arguments(0))
- >>iget.vbs echo Set xPost=CreateObject("Microsoft.XMLHTTP")
- >>iget.vbs echo xPost.Open "GET",y,0
- >>iget.vbs echo xPost.Send()
- >>iget.vbs echo Set sGet=CreateObject("ADODB.Stream")
- >>iget.vbs echo sGet.Mode=3
- >>iget.vbs echo sGet.Type=1
- >>iget.vbs echo sGet.Open()
- >>iget.vbs echo sGet.Write(xPost.responseBody)
- >>iget.vbs echo sGet.SaveToFile x,2
- goto :eof
- :::::::::::::::::::::所有错误start::::::::::::::::::::::
- :参数错误
- echo 参数错误,用户名\密码\收件人\主题中某一项缺少
- goto :eof
- :压缩文件错误
- echo 压缩文件失败
- goto :eof
- :附件大小超出
- echo 附件大小超出
- goto :eof
- :登陆不成功
- echo 登陆不成功
- goto :eof
- :发信不成功
- echo 发信不成功
- goto :eof
- :::::::::::::::::::::所有错误end::::::::::::::::::::::
复制代码
作者: hxinhu12315 时间: 2009-10-1 09:33
! C:\Documents and Settings\Administrator\桌面\批处理之家论坛下载_p-mailsend_v4.0.rar: 不可预料的压缩文件末端
作者: Seter 时间: 2009-10-1 14:27
原帖由 hxinhu12315 于 2009-10-1 09:33 发表
! C:\Documents and Settings\Administrator\桌面\批处理之家论坛下载_p-mailsend_v4.0.rar: 不可预料的压缩文件末端
可以解压就可以了,不要那么讲究
居然用NC发送邮件..真强
作者: linmiaojing 时间: 2010-4-5 11:01
真是有字天书!看不懂
作者: weiluz 时间: 2013-12-19 18:33
nc.exe 很容易给杀毒软件 但病毒查杀了,导致文件丢失无法正常使用了。
作者: xybzm 时间: 2014-2-21 17:17
楼上说得很对。。
作者: Hodson124 时间: 2014-3-7 08:26
解压不了啊!
作者: wuhengsi 时间: 2014-6-20 21:38
凡是可杀的。。。可视为废物一个。。。无用
作者: shh200438 时间: 2014-6-29 07:07
太赞了, 写这么个批处理不容易啊, 辛苦了.
作者: shh200438 时间: 2014-6-29 07:10
太赞了, 写这么个批处理不容易啊, 辛苦了.
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |