Exception handling with CDO.message
I am using code based on the following to send an email from a form on my site. One to me, and a confrmation email to the customer.
cdoConfig.fields.item(theSchema & "sendusing")=2
cdoConfig.fields.item(theSchema & "smtpserver")="my.smtp.server"
The problem is, that if the customer enters an incorrect email address, the site displays an error message.
I have an error page set up, informing the customer that their message couldn't be sent, and directing them back to check their email address, but how do I get it to divert to this page, rather than throwing an unhelpful error message?
Any help would be gratefully appreciated.
Before the cdoMessage.send line add the following:
then after the cdoMessage.send line add the following:
On Error Resume Next
You may want to check the error number to be sure that the e-mail address was the problem.
If Err.Number <> 0 Then
Users Browsing this Thread
There are currently 3 users browsing this thread. (0 members and 3 guests)