Jump to content

Command Prompt E-mail?


un4given1

Recommended Posts

Does anyone know of a free command prompt e-mail client? Or, does anyone know of a way to automate sending an email through Exchange? The idea being I want our server to e-mail me if the power ever goes out. I can do this VIA use of batter backup but the limitation is it simply lets you run a command.

All help is appreciated.

Link to comment
Share on other sites


I've been working on this today and here is the answer

Download a small, free tool called Telnet Scripting Tool. Actual exe is called TST10.EXE.

Create a batch file called e-mail.cmd and enter the following commands

tst10.exe /r:script.txt /o:output.txt /m

Create a text file called script.txt and enter the following commands

Your Mail Server 25

wait " "

send "helo your_domain_name\m"

wait " "

Send "Mail From:Sending_E-Mail_Address\m"

wait " "

Send "RCPT To:Receiving_E-Mail_Address\m"

wait " "

send "DATA\m"

Wait " "

Send "Subject: Test From telnet\mWullie wrote this.\m.\m"

wait " "

send "Quit\m"

Please note that you will need to edit the items in red for this to work.

I have attached the relevant files for you to use.

Hope this helps

Wullie

Link to comment
Share on other sites

using mapisend..

mapisend -i -r mail@mail.co.uk -s "I've just run the shared desktop

batch" -m "\\%computername%\Desktop"

but I get an exchange settings confirmation window, is there any way I can send a 'enter' command to the active window?

Link to comment
Share on other sites

Why not create your own script file?

Example one: using SMTP server

'Notifications by SMTP
'Soulin
'11.11.2004

Option Explicit
On Error Resume Next

Dim objArguments, objNamed

set objArguments  = WScript.Arguments
set objNamed = WScript.Arguments.Named

Call OdoslanieMailu
Set objShell = Nothing

Wscript.Quit(0)

Sub OdoslanieMailu
Dim objEmail, objNetwork
Dim strComputerName

Set objEmail = CreateObject("CDO.Message")
Set objNetwork = CreateObject("Wscript.Network")

strComputerName = objNetwork.ComputerName

With objEmail
   .From =  "autoupdate@supersupport.org"
   .To = "notify@supersupport.org"
   .Subject = objNamed("update") & " updated."
   .Textbody = "blablabla"
   .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.supersupport.org"
   .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
   .Configuration.Fields.Update
   .Send
End With

Set objEmail = Nothing
Set objNetwork = Nothing
End Sub

By using existing Outlook configuration (for Exchange for example):

Option Explicit

Dim objOutlook, objNameSpace, objMail
Dim strAddress, strSubject, strBody, strMailItem

strAddress = "test@supersupport.org"
strSubject = "Test"
strBody = "Test message"

Set objOutlook = WScript.CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.getNamespace("MAPI")
Set objMail = objOutlook.CreateItem(strMailItem)

objMail.Subject = strSubject
objMail.Body = strBody
objMail.RecipIents.Add(strAddress)
objMail.Send

SET objOutlook = nothing
SET objNameSpace = nothing
SET objMail = nothing

Is this what you were looking for?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...