I am using the following code to send an email in this .vbs file:
set objMail = WScript.CreateObject("CDo.Message")
objMail.configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/SendUsing") = 2 ' using cdosendusingport
objMail.configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Mail.mycompany.org"
objMail.configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/SMTPServerPort") = 25
objMail.configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/SMTPAuthenticate") = 0 'cdoAnonymous
objMail.configuration.Fields.Update
objMail.From = "
[email protected]"
strMailBody = "This Email Created/Sent: " & Now() & vbcrlf & vbcrlf
objmail.Subject = "A DotNet Application Error(s) Text File Created on " & strServerName
'***** DEV - EMAIL. *****
objmail.To = "
[email protected]"
strMailBody = strMailBody & "A DotNet Application Error(s) Text File has been created on " & strServerName & " in:" & vbcrlf & vbcrlf
strMailBody = strMailBody & "X:\inetpub\logfiles\dotneterrors" & strDate & ".txt" & vbcrlf & vbcrlf
objmail.textbody = strMailBody
objmail.Send
I need a way to attach the file that is in X:\inetpub\logfiles\dotneterrors.txt
Any direction or resource or help that anyone can provide would be appreciated. I've been looking this afternoon but to no avail.
Thank you.