Send a test email via a VB Script

Posted by robd on May 15, 2012
SMTP

This is a great one!

Are you trying to fix SMTP or relaying or some email shit and you really need to send a test email but really can’t remember the telnet commands!!

Well this is helpful!!

It’s a VB Script that send a test email!  Specify the From user, To user and finally the SMTP server address and your done!!

 

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "FROM.ADDRESS@DOMAIN.COM"
objEmail.To = "TO.ADDRESS@DOMAIN.COM"
objEmail.Subject = "This is your conscience" 
objEmail.Textbody = "This is your conscience, stop calling flirting with Nia!!"
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
        "SMTP.YOURSERVER.FULLY.QUALIFIED.DOMAIN" 
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

Tags:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.