Created
September 9, 2016 14:12
-
-
Save Maslor/27dccbef81021a1b97da01cdddd06dcc to your computer and use it in GitHub Desktop.
script that sends emails from selected email (any email of your choosing). Replace "mail.server" with the desired mail server and "port" with the required port (usually 25).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<job> | |
<script language="VBScript"> | |
Option Explicit | |
On Error Resume Next | |
Dim WshShell | |
set WshShell=CreateObject("WScript.Shell") | |
WshShell.run "cmd.exe" | |
WScript.Sleep 1000 | |
'Step 1 - Telnet to remote IP' | |
WshShell.SendKeys "telnet mail.server port(usually 25)" | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
'Step 2 - Issue Commands with pauses' | |
WshShell.SendKeys ("ehlo mail.server port(usually 25)") | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
Dim origin | |
origin = InputBox("Enter the email you want to use as the origin:") | |
WshShell.SendKeys ("mail from: " & origin) | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
Dim destination | |
destination = InputBox("Enter the recipient of the email:") | |
WshShell.SendKeys ("rcpt to: " & destination) | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
Dim title | |
title = InputBox("Enter your email's subject:") | |
Dim text | |
text = InputBox("Enter your email's content:") | |
WshShell.SendKeys ("data") | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
WshShell.SendKeys ("Subject: " & title) | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
WshShell.sendKeys (text) | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
WshShell.SendKeys (".") | |
WshShell.SendKeys ("{Enter}") | |
WScript.Sleep 1000 | |
WshShell.SendKeys ("quit") | |
WshShell.SendKeys ("{Enter}") | |
</script> | |
</job> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment