Automatic e-mail by script under Windows

Source: Internet
Author: User

Create a script file, name it arbitrarily, extend VBS

Subject=wscript.arguments (0) content=wscript.arguments (1) set sh=wscript.createobject ("WScript.Shell") host= Wscript.fullnameif lcase (Right (host,11)) = "Wscript.exe"  Then    sh.run  " cscript //nologo  "" "&NBSP;&AMP;&NBSP;WSCRIPT.SCRIPTFULLNAME&NBSP;&AMP;&NBSP;CHR (, 0 )    WSCript.QuitEnd Ifsh.Run  "cmd.exe" wscript.sleep 1000sh. sendkeys  "Telnet" sh. SendKeys ("{Enter}") Wscript.sleep 1000sh. sendkeys  "Open smtp.somesome.com 25"  sh. SendKeys ("{Enter}") Wscript.sleep 1000sh. sendkeys  "Helo somesome.com"  sh. SendKeys ("{Enter}") Wscript.sleep 500sh. sendkeys  "Auth login"  sh. SendKeys ("{Enter}") Wscript.sleep 500sh. sendkeys  "xxxxxxx"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "xxxxxxx"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "Mail from:<[email protected]>"  sh. SendKeys ("{Enter}") Wscript.sleep 500sh. sendkeys  "Rcpt to:<[email protected]>"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "Rcpt to:<[email protected]>"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "Data"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "From:test1"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "To:test2"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "Subject:"  & subject sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  ""  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. Sendkeys content sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  ""  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. sendkeys  "."  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. SendKeys ("{Enter}") Wscript.sleep 1000sh. sendkeys  "Quit"  sh. SendKeys ("{Enter}") Wscript.sleep 5000sh. SendKeys ("{Enter}") Wscript.sleep 2000sh. sendkeys  "Quit"  sh. SendKeys ("{Enter}") Wscript.sleep 100sh. SendKeys ("Exit{enter}") Wscript.Quit

To start the script, pass in the parameters:

cscript//nologo Sendmail3.vbs subject-%time% content111


This article is from the "zl1030 Records" blog, so be sure to keep this source http://zl1030.blog.51cto.com/274507/1926402

Automatic e-mail by script under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.