I have an email script I was using at previous company. Now I want to incorporate something similiar at different company. However I can't get it to work. So instead of duplicating it, I was wondering if there is some very, very, very basic email script that I can use to validate whether or not I have the 'email server' correctly. Idea would be to successfully email myself by executing it. Then I can modify the more complex one that passes in variables etc. The erors on VB are cryptic to me and can't tell what the issue is.
Here's my current code:
'%ENV_NAME% Variable passed into the script
strLocation1 = Wscript.Arguments.Item(0)
'%EMAILSVR% Variable passed into the script
strLocation2 = Wscript.Arguments.Item(1)
'%EMAIL_TO% Variable passed into the script
strLocation3 = Wscript.Arguments.Item(2)
'%LOGDIR% Variable passed into the script
'strLocation4 = Wscript.Arguments.Item(3)
'%LOGFILENAME% Variable passed into the script
'strLocation5 = Wscript.Arguments.Item(4)
strTo = "" & strLocation3 & ""
Set objfso = CreateObject("Scripting.FileSystemObject")
strSubject = "WARNING!! - Another Hyperion maintenance is processing on " & strLocation1 & ""
strBody = "Unable to execute Hyperion maintenance process on " & strLocation1 & ". There is another process currently running. Please try again later or when the other process is finished."
'strAttachFile = strLocation4 & "" & strLocation5 & ""
EMail "Admin@Company.com", strTo, strSubject, strBody,"" & strLocation2 & "" ,strAttachFile
Set objEmail = CreateObject("CDO.Message")
.From = sourceAddr
.To = destAddr
.Subject = subjectText
.TextBody = textBody
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "" &strLocation2 & ""
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Thanks for all help. Always tricky when trying to get email working for some reason.