G
Guest
I am trying to create a script that will send an email using CDOSYS. I have
listed the code in the .vbs script below. Can anyone see a problem with this
script? It is not sending emails. If this is the wrong forum please let me
know which is the correct forum to post this question. Please note that all
NewMail.Configuration.Fields.Item entries are on one line, not two. Also, the
password is set to "" for an empty string because this particular temp user
does not have a password. Here is the code:
On Error Resume Next
RCP = "(e-mail address removed)"
FROM = "(e-mail address removed)"
SUB = "System Restart"
MSG = "This system was successfully restarted."
Set NewMail = CreateObject("CDO.Message")
NewMail.Subject = SUB
Newmail.Sender = FROM
NewMail.To = RCP
NewMail.TextBody = MSG
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"192.168.1.18"
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/authenticate") = 1
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user2"
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
NewMail.Configuration.Fields.Update
NewMail.Send
listed the code in the .vbs script below. Can anyone see a problem with this
script? It is not sending emails. If this is the wrong forum please let me
know which is the correct forum to post this question. Please note that all
NewMail.Configuration.Fields.Item entries are on one line, not two. Also, the
password is set to "" for an empty string because this particular temp user
does not have a password. Here is the code:
On Error Resume Next
RCP = "(e-mail address removed)"
FROM = "(e-mail address removed)"
SUB = "System Restart"
MSG = "This system was successfully restarted."
Set NewMail = CreateObject("CDO.Message")
NewMail.Subject = SUB
Newmail.Sender = FROM
NewMail.To = RCP
NewMail.TextBody = MSG
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"192.168.1.18"
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/authenticate") = 1
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user2"
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
NewMail.Configuration.Fields.Item
_("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
NewMail.Configuration.Fields.Update
NewMail.Send