I'm trying to create and send an email of a report that is generated earlier
in a vbscript file, and I have been successful in generating and sending the
email, but when I try to add an attachment, it gives me an error message
saying the CDO.Message object does not support the method "AddAttachment".
Here's the code I'm using to generate an email:
set objEmail = CreateObject ("CDO.Message")
'generate email of log file every time it is executed
'objEmail.From = "sshah@soa.org"
'objEmail.To = "sshah@soa.org"
'objEmail.Subject = "Content publishing report"
'objEmail.Textbody = "This is the log file from the content migration at "
& now
'objEmail.AddAttachment = "c:\sys\migration_logfile.txt"
'objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "remote
server"
'objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'objEmail.Configuration.Fields.Update
'objEmail.Send