4dam
11-17-2005, 04:38 AM
Hi,
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.
<%
theSchema="http://schemas.microsoft.com/cdo/configuration"
set cdoConfig=server.CreateObject("CDO.configuration")
cdoConfig.fields.item(theSchema & "sendusing")=2
cdoConfig.fields.item(theSchema & "smtpserver")="my.smtp.server"
cdoConfig.fields.update
set cdoMessage=server.createObject("cdo.message")
cdoMessage.configuration=cdoConfig
cdoMessage.from=request.form("email")
cdoMessage.to=request.form("to")
cdoMessage.subject=request.form("subject")
cdoMessage.textbody=request.form("message")
cdoMessage.send
set cdoConfig=nothing
set cdoMessage=nothing
%>
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.
Thanks,
Adam
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.
<%
theSchema="http://schemas.microsoft.com/cdo/configuration"
set cdoConfig=server.CreateObject("CDO.configuration")
cdoConfig.fields.item(theSchema & "sendusing")=2
cdoConfig.fields.item(theSchema & "smtpserver")="my.smtp.server"
cdoConfig.fields.update
set cdoMessage=server.createObject("cdo.message")
cdoMessage.configuration=cdoConfig
cdoMessage.from=request.form("email")
cdoMessage.to=request.form("to")
cdoMessage.subject=request.form("subject")
cdoMessage.textbody=request.form("message")
cdoMessage.send
set cdoConfig=nothing
set cdoMessage=nothing
%>
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.
Thanks,
Adam