I am using CDO / ASP to send email via a remote server.
In 4 out of 5 accounts it is working. Each account is using a separate mail server and username/password.
The problem account has the correct username, password, and mail server settting. I know this because using Outlook I am able to send an receive messages.
Is there a setting on the mail server of the problem account that may be preventing the proper sending of the emails?
One suggested answer was that the server isn't allowing emails to be relayed from my server: http://bytes.com/forum/thread53504.html
However, since I can send through outlook, doesn't this rule that out?
From here: http://classicasp.aspfaq.com/email/why-does-cdo-message-give-me-8004020f-errors.html
1) I don't think the SMTP server requires authentication since I can send it via Outlook without it
2) A possible error
5) Didn't resolve the issue
On Error Resume Next
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout = "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName = "http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword = "http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = smtp_mail_server
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = smtp_username
.Item(cdoSendPassword) = smtp_password
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
.To = "firstname.lastname@example.org"
.From = smtp_username & "<" & smtp_username & ">"
.Subject = "Test Message: " & smtp_username
.TextBody = "This is a test message to see if your email settings were configured properly"
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
If Err.Number <> 0 Then
Call DisplayError("We were able to connect to the mail server. However, there appears to be a setting on your server that is preventing the proper relaying of messages. Please recheck the settings and try again or leave the settings blank.")