troubleshooting Question

VB script to send pop mail only performs intermittently

Avatar of ddantes
ddantesFlag for United States of America asked on
VB ScriptEmail Protocols
10 Comments1 Solution139 ViewsLast Modified:
I am a novice at scripting.  I have a script which is supposed to send me an Email when it is activated, but it only does that some of the time.  I'd appreciate guidance about improving this, so that the Email is sent consistently.  Below is the script.  Some of the text has been removed, so only ""  appears, in order to preserve privacy regarding contact information, passwords, etc.

Dim emailObj
Set emailObj      = CreateObject("CDO.Message")
emailObj.From     = ""

emailObj.To       = ""

emailObj.Subject  = ""
emailObj.TextBody = ""

Dim emailConfig
Set emailConfig = emailObj.Configuration

emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.maui.net"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")    = 2  
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1  
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl")      = false 
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")    = ""
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")    = ""
emailConfig.Fields.Update

emailObj.Send

'If err.number = 0 then Msgbox "Done"
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros