I'm getting a bit frustrated with this as I go around on it again. The last time I puttered with it for almost 12 hours before it inexplicably started working. Adding insult to injury, I'm using the script that I got working before!
I have a simple contact form that is supposed to send an email to the client's email address and a copy to the visitor. The client's email is hosted on JH servers and goes through immediately. However, the CC goes to another email server and is not being sent. I assume the problem is with authentication.
The code I am using is based on code that has been posted on these boards. My version follows:
**********
Dim objMessage
Dim objSettings
Dim iFlds
Set objMessage = Server.CreateObject("CDO.Message")
Set objSettings = Server.CreateObject("CDO.Configuration")
Set iFlds = objSettings.Fields
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mydomain.net"
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'SMTP port
iFlds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'CDO Port
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'timeout
'outgoing authentication
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
iFlds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
iFlds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
iFlds.Update
Set objMessage.Configuration = objSettings
With objMessage
.From = Request.Form("txtSenderName") & " <" & Request.Form("txtFromAddress") & ">"
.To = "[email protected]"
.Cc = Request.Form("txtSenderName") & "<" & Request.Form("txtFromAddress") & ">"
.Subject = Request.Form("txtEmailSubject") & " (sent via contact form)"
.TextBody = Request.Form("txtEmailBody")
.HTMLBody = "<p>" & Replace(Request.Form("txtEmailBody"), vbCrLf & vbCrLf, "</p><p>") & "</p>"
.Send
End With
Set objMessage = Nothing
***************
I have verified that all email addresses, mail server addresses, and passwords are correct. My reseller account has a TLD of .net and my business email address is .com., so if anyone was going to mention that, it is correct. I don't know what else to check at this point. Any help will be greatly appreciated.
I have a simple contact form that is supposed to send an email to the client's email address and a copy to the visitor. The client's email is hosted on JH servers and goes through immediately. However, the CC goes to another email server and is not being sent. I assume the problem is with authentication.
The code I am using is based on code that has been posted on these boards. My version follows:
**********
Dim objMessage
Dim objSettings
Dim iFlds
Set objMessage = Server.CreateObject("CDO.Message")
Set objSettings = Server.CreateObject("CDO.Configuration")
Set iFlds = objSettings.Fields
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mydomain.net"
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'SMTP port
iFlds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 'CDO Port
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'timeout
'outgoing authentication
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
iFlds("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
iFlds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
iFlds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
iFlds.Update
Set objMessage.Configuration = objSettings
With objMessage
.From = Request.Form("txtSenderName") & " <" & Request.Form("txtFromAddress") & ">"
.To = "[email protected]"
.Cc = Request.Form("txtSenderName") & "<" & Request.Form("txtFromAddress") & ">"
.Subject = Request.Form("txtEmailSubject") & " (sent via contact form)"
.TextBody = Request.Form("txtEmailBody")
.HTMLBody = "<p>" & Replace(Request.Form("txtEmailBody"), vbCrLf & vbCrLf, "</p><p>") & "</p>"
.Send
End With
Set objMessage = Nothing
***************
I have verified that all email addresses, mail server addresses, and passwords are correct. My reseller account has a TLD of .net and my business email address is .com., so if anyone was going to mention that, it is correct. I don't know what else to check at this point. Any help will be greatly appreciated.