T
Tech_vs_Life
After switching from XP to Vista, I'm having problems with some code that
makes use of cdo (I'm using my ISP email account to send mail via smtp).
Initially I got back an error:
The 'SendUsing' configuration value is invalid.
But after configuring Windows mail and Outlook with the email account (a
step that used to resolve cdo problems on XP), the same code produced an
entirely different error:
Error reported: -2147220975. The message could not be sent to the SMTP
Server. The transport error code was 0x80040217. The server response was
not available.
Sending via Windows mail or Outlook works fine, but I need to send via cdo
code.
Note that this code worked fine in XP. The code is as follows (I've already
tried setting cdoSMTPUseSSL to false, but it didn't help.):
Const ksFrom As String = "(e-mail address removed)"
Dim oCfg As cdo.Configuration
Dim oMsg As cdo.Message
Set oCfg = New cdo.Configuration
With oCfg.Fields
!cdoSendUsingMethod = cdoSendUsingPort
!cdoSMTPServer = "smtp.comcast.net"
!cdoSMTPServerPort = 25
!cdoSMTPConnectionTimeout = 120
!cdoSMTPAuthenticate = cdoBasic
!cdoSMTPUseSSL = True
!cdoSendUserName = "SenderName"
!cdoSendPassword = "password"
.Update
End With
Set oMsg = New cdo.Message
With oMsg
Set .Configuration = oCfg
.To = sTo
.From = ksFrom
.Sender = ksFrom
.Subject = sSubject
.ReplyTo = "(e-mail address removed)"
If Len(sCC) Then .CC = sCC
If Len(sBCC) Then .BCC = sBCC
If Len(sFileName) Then .AddAttachment sFileName
If Len(sMsg) Then .TextBody = sMsg
.Send
End With
Set oMsg = Nothing
Set oCfg = Nothing
EmailDocs = True
Exit Function
makes use of cdo (I'm using my ISP email account to send mail via smtp).
Initially I got back an error:
The 'SendUsing' configuration value is invalid.
But after configuring Windows mail and Outlook with the email account (a
step that used to resolve cdo problems on XP), the same code produced an
entirely different error:
Error reported: -2147220975. The message could not be sent to the SMTP
Server. The transport error code was 0x80040217. The server response was
not available.
Sending via Windows mail or Outlook works fine, but I need to send via cdo
code.
Note that this code worked fine in XP. The code is as follows (I've already
tried setting cdoSMTPUseSSL to false, but it didn't help.):
Const ksFrom As String = "(e-mail address removed)"
Dim oCfg As cdo.Configuration
Dim oMsg As cdo.Message
Set oCfg = New cdo.Configuration
With oCfg.Fields
!cdoSendUsingMethod = cdoSendUsingPort
!cdoSMTPServer = "smtp.comcast.net"
!cdoSMTPServerPort = 25
!cdoSMTPConnectionTimeout = 120
!cdoSMTPAuthenticate = cdoBasic
!cdoSMTPUseSSL = True
!cdoSendUserName = "SenderName"
!cdoSendPassword = "password"
.Update
End With
Set oMsg = New cdo.Message
With oMsg
Set .Configuration = oCfg
.To = sTo
.From = ksFrom
.Sender = ksFrom
.Subject = sSubject
.ReplyTo = "(e-mail address removed)"
If Len(sCC) Then .CC = sCC
If Len(sBCC) Then .BCC = sBCC
If Len(sFileName) Then .AddAttachment sFileName
If Len(sMsg) Then .TextBody = sMsg
.Send
End With
Set oMsg = Nothing
Set oCfg = Nothing
EmailDocs = True
Exit Function