Hi all,
I am sending mail from my apps with CDO nowadays.
However I have one client where this will not work until now.
I am thinking this is related to the provider where the client has his internet-account.
I am using cdosys with 'late binding'. I try to send mail with an attachment to a few mailaddresses (strTo)
The *exact same code* (with other smtpserver-login and pw strings) does work on various other PC's with various other providers.
The code:
SendCDOMail "Subject... " & Format(Date, "dd-mm-yyyy"), msg, strTo, "C:\svb\output. html"
Sub SendCDOMail(str Subject, strBody, strTo, strAttach)
On Error GoTo Err_SendCDOMail
Const cdoSendUsingPic kup = 1
Const cdoSendUsingPor t = 2 'Must use this to use Delivery Notification
Const cdoAnonymous = 0
Const cdoBasic = 1 ' clear text
Const cdoNTLM = 2 'NTLM
'Delivery Status Notifications
Const cdoDSNDefault = 0 'None
Const cdoDSNNever = 1 'None
Const cdoDSNFailure = 2 'Failure
Const cdoDSNSuccess = 4 'Success
Const cdoDSNDelay = 8 'Delay
Const cdoDSNSuccessFa ilOrDelay = 14 'Success, failure or delay
Dim objMsg As Object
Dim objConf As Object
Dim objFlds As Object
Set objMsg = CreateObject("C DO.Message")
Set objConf = CreateObject("C DO.Configuratio n")
Set objFlds = objConf.Fields
With objFlds
.Item("http://schemas.microso ft.com/cdo/configuration/sendusing") = cdoSendUsingPor t
.Item("http://schemas.microso ft.com/cdo/configuration/smtpserver") = "smtpserver here"
..Item("http://schemas.microso ft.com/cdo/configuration/smtpauthenticat e") = cdoBasic
.Item("http://schemas.microso ft.com/cdo/configuration/sendusername") = "account here"
.Item("http://schemas.microso ft.com/cdo/configuration/sendpassword") = "password here"
.Update
End With
With objMsg
Set .Configuration = objConf
.To = strTo
.Subject = strSubject
.cc = bl*@test.nl
.From = blabl*@test.nl
.TextBody = strBody
.AddAttachment strAttach
.DSNOptions = cdoDSNFailure
.Fields.Update
.Send
End With
Exit Sub
Err_SendCDOMail :
MsgBox Err & " " & Error$, vbCritical, TITEL
End Sub
Thanks for any ideas...
Arno R