|
When i run the following script I get "The command completed successfully reported back using the @serror macro for everyline but still receive no emial. The vbscript version of this works correctly.
REDIRECTOUTPUT ("c:\output.txt",0)
$objEmail = CreateObject("CDO.Message") @serror $objEmail.From = "scripterror@mydomain.com" @serror $objEmail.To = "me@mydomain.com" @serror $objEmail.Subject = "Subject" @serror $objEmail.Textbody = "body" @serror $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") .Value = 2 @serror $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") .Value = "mail.myddomain.com" @serror $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") .Value = 25 @serror $objEmail.Configuration.Fields.Update @serror $objEmail.Send @serror
EXIT [ 12. June 2003, 22:40: Message edited by: ktodi ]
|