I looked it over; I found some minor issues; and here are some suggestions below;
To avoid using it only once /x, it is suggested to initialize user and others at the beginning
: There is a missing goto :eof at the end of the sending program
This error will lead to
: After the sending program is executed, it will immediately execute :Judge whether the login is successful;
Add a sentence after call :Judge whether the login is successful
if errorlevel 1 goto :del_
Otherwise, it will continue to send the letter regardless of whether the login is successful;
When calling call :Judge whether the sending is successful, some other unnecessary information will appear; and if the sending is not successful, the prompt for unsuccessful sending will appear twice;
And finally, it will also echo All letters sent successfully;
It is suggested to add
cls
if errorlevel 1 echo Sending failed & goto del_
before
call :del
echo All letters sent successfully
In the :Interactive mode
if not defined user (set/p=Username:<nul&set/p "user= ")
It can be simply written as: if not defined user (set/p "user=Username: ")
And so on
for /f "tokens=2 delims=" %%? in ('ping -n 1 smtp.163.com ^|findstr /i "^Pinging"') do (set "ip=%%?")
It is suggested to change Pinging to ping otherwise Vista cannot successfully find the ip
Vista's echo is:
正在 Ping smtp.163.split.netease.com 具有 32 字节的数据:
来自 220.181.12.13 的回复: 字节=32 时间=35ms TTL=51
220.181.12.13 的 Ping 统计信息:
数据包: 已发送 = 1,已接收 = 1,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 35ms,最长 = 35ms,平均 = 35ms
It should move the if "%1"=="vkill" goto :eof under help to before help; otherwise it will lose its proper function;