Sending Email via VBScript
VBScriptMy buddy EV posted on how to send email via MS SQL Server . Not to be out done, here is how to send email via VBScript.
Sending an email from VBScript is pretty easy. Here is a basic example. Note that you will have to identify your SMTP Server. Also, "& _" was added to make it a little easier to read. It should work this way, but you can also remove the "& _" and have the line below it on the same line as it (if that makes sense).
Set objEmail = CreateObject("CDO.Message")
objEmail.Configuration.Fields.Item( & _
"http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item( & _
"http://schemas.microsoft.com/cdo/configuration/smtpserver") = &_
"some.smtp.server.com"
objEmail.Configuration.Fields.Item( & _
"http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.From = "me@something.com"
objEmail.To = "someone@something.com"
objEmail.Subject = "Test Message"
objEmail.Textbody = "This is a test message."
objEmail.Send
Set objEmail = nothing





Loading....