Hi.
We have an excel 2007 that emails out PDF invoices. It uses CDO code that has been working fine for the last 2 years using gmail as the email system.
We have now changed to our own website address, and have changed the parameters to those required by the ISP. Have tried ports 25, 465 and 587, but always get the same error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
The OS is win10, the local pc has not changed.
Can send mail out on that account using Thunderbird as local client, which has the same smpt account details and port details (465)
We have an excel 2007 that emails out PDF invoices. It uses CDO code that has been working fine for the last 2 years using gmail as the email system.
We have now changed to our own website address, and have changed the parameters to those required by the ISP. Have tried ports 25, 465 and 587, but always get the same error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
The OS is win10, the local pc has not changed.
Can send mail out on that account using Thunderbird as local client, which has the same smpt account details and port details (465)
Code:
If IsEmailValid(eMailAddress) Then
' Email section starts here
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpusessl")[/URL] = True
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")[/URL] = cdoBasic
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusername")[/URL] = "treasurer@xxxxxxxx.org.uk"
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendpassword")[/URL] = "password_goes_here"
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "smtp.xxxxxxxx.org.uk"
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = cdoSendUsingPort
.Item("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 587
.Update
End With
strbody = "line1" & vbNewLine & vbNewLine _
& "line2" & vbNewLine & vbNewLine _
& "line3" & vbNewLine & vbNewLine _
With iMsg
Set .Configuration = iConf
.To = Worksheets("Unpaid General Fees").Range("R" & i).Value
.CC = ""
.BCC = ""
.From = "treasurer@xxxxxxxx.org.uk"
.Subject = "Invoice for " & Worksheets("Unpaid General Fees").Range("B" & i).Value & (Resent)
.TextBody = strbody
.AddAttachment folder + "\" + pdfName
.Send
End With
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
' Email section ends here
Set iMsg = Nothing
Set iConf = Nothing
Worksheets("Unpaid General Fees").Range("T" & i).Value = "eMailed"
Else
Worksheets("Unpaid General Fees").Range("T" & i).Value = "To Be Posted"
End If
End If