Hi
I am having a problem with certain word documents I am sending via CDO message. Some attachments are ok but some cause problems when they are being opened in word. The original document is ok, it is just the attachment that is causing a problem.
The code i am using is
Set MyMail = CreateObject("CDO.Message")
Set cdoConfig = CreateObject("CDO.Configuration")
with cdoConfig.fields
.item(" = 2
end with
Set MyMail.Configuration = cdoConfig
MyMail.From = "WitsBaseVBmail"
MyMail.To = toAddr
MyMail.Subject = subject
MyMail.TextBody = body
'
WScript.Echo "--------------------------------------------------------------------------"
If WScript.Arguments.Count >3 Then
For Each sAttach In FileArray
MyMail.AddAttachment sAttach
If Err.Number = 0 Then
WScript.Echo "File " & sAttach & " has been attached to message"
Else
WScript.Echo "File " & sAttach & " has not been attached, err - " & Err.Number
End If
WScript.Echo "--------------------------------------------------------------------------"
'wscript.sleep 30000
Next
End If
'
MyMail.Send()
on a 2003 server. Any suggestions please?
Cheers
I am having a problem with certain word documents I am sending via CDO message. Some attachments are ok but some cause problems when they are being opened in word. The original document is ok, it is just the attachment that is causing a problem.
The code i am using is
Set MyMail = CreateObject("CDO.Message")
Set cdoConfig = CreateObject("CDO.Configuration")
with cdoConfig.fields
.item(" = 2
end with
Set MyMail.Configuration = cdoConfig
MyMail.From = "WitsBaseVBmail"
MyMail.To = toAddr
MyMail.Subject = subject
MyMail.TextBody = body
'
WScript.Echo "--------------------------------------------------------------------------"
If WScript.Arguments.Count >3 Then
For Each sAttach In FileArray
MyMail.AddAttachment sAttach
If Err.Number = 0 Then
WScript.Echo "File " & sAttach & " has been attached to message"
Else
WScript.Echo "File " & sAttach & " has not been attached, err - " & Err.Number
End If
WScript.Echo "--------------------------------------------------------------------------"
'wscript.sleep 30000
Next
End If
'
MyMail.Send()
on a 2003 server. Any suggestions please?
Cheers