Can't get CDO email validation to work

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/70392?pagenum=1
04 November 2025, 18:48

Topic


kerryww
Can't get CDO email validation to work
10 January 2013, 18:57


Hi,

I've recently changed hosts from a MS2003 server to an account with Arvixe.com with a MS2008 server. I uploaded the files and got everything up and running without much trouble - except user email validation. I've tried everything, checked, rechecked and checked again over the last 2 days, but no love.
I have tried code sent to me from Arvixe and the code in SF but nothing works. I looked at every other post on the subject in the forum and tried the suggestions, but nothing works.
Any suggestions much appreciated.
Kerry

Here is my most recent code attempt in inc_mail.asp
Code:
case "cdosys"
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields

'Set and update fields properties
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mail.orientbeachadultforum.com
'Flds ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'added by me

Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "moderator@orientbeachadultforum.com"
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "secret"
Flds.Update
Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf
'Format and send message
Err.Clear
objNewMail.To = strRecipients
objNewMail.From = strSender
objNewMail.Subject = strSubject
objNewMail.TextBody = strMessage
On Error Resume Next
objNewMail.Send
If Err <> 0 Then
Err_Msg = Err_Msg & "<li>Your request was not sent due to the following error: " & Err.Description & "</li>"
End if


Here is the code Arvixe suggested I use
Code:
<%
Set objMail = Server.CreateObject("CDO.Message")
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields

With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.tld"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "emailuser@domain.tld"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Update
End With

With objMail
Set .Configuration = objConf
.From = "useremail@domain.tld"
.To = "email destination"
.Cc = "other email"
.Subject = "subject of the email"
.TextBody = "body of the text"
End With

Err.Clear
on error resume next

objMail.Send
if len(Err.Description) = 0 then

response.write "Mail sent successfully "
else

response.write "Mail not sent successfully"
response.write err.Description & " "

end if
Set objFields = Nothing
Set objConf = Nothing
Set objMail = Nothing
%>

 

Replies ...


Podge
11 January 2013, 06:36


Code:
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mail.orientbeachadultforum.com
shoudl be

Code:
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.orientbeachadultforum.com"

Do you get any errors anywhere i.e. in your browser or in the mail server logs? Can you do a tracert to the email server? Is there a firewall on your server?
kerryww
11 January 2013, 22:24


Hi Podge,

Thanks for your help. I guessed it was going to be something really simple and it was. "mail.orientbeachadultforum.com" worked.
It's amazing how something is looking you in the eye all day and you miss it completely. Until someone else comes along and picks your mistake instantly. My learning ASP from a book called ASP for Dummies that I borrowed from the library doesn't help either :)

Thanks again,

Kerry
Podge
12 January 2013, 08:44


Glad you got it working.
© 2000-2021 Snitz™ Communications