I'm a designer not a programmer and have a basic question about my mail form. Currently if someone enters an email address that isn't formatted properly (EG. just without @.com etc.), the browser brings up a server error message. However I would like the user to be redirected to a specified page, but I don't know how to do this.
If someone could let me know what code to use and where to insert it, that would be greatly appreciated.
thanks in advance,
MyEmailFrom = Request.Form("EmailFrom")
MySubject = "Wedding Films Website Enquiry"
MyName = Request.Form("Name")
MyPhone = Request.Form("Phone")
MyWeddDate = Request.Form("WeddDate")
MyWeddLocation = Request.Form("WeddLocation")
MyHowHearAboutUs = Request.Form("HowHearAboutUs")
MyReferralFrom = Request.Form("ReferralFrom")
MyMessage = Request.Form("Message")
MyBody = MyBody & "Name: "& MyName & VbCrLf
MyBody = MyBody & "Phone: "& MyPhone & VbCrLf
MyBody = MyBody & "WeddDate: "& MyWeddDate & VbCrLf
MyBody = MyBody & "WeddLocation: "& MyWeddLocation & VbCrLf
MyBody = MyBody & "HowHearAboutUs: "& MyHowHearAboutUs & VbCrLf
MyBody = MyBody & "ReferralFrom: "& MyReferralFrom & VbCrLf
MyBody = MyBody & "Message: "& MyMessage & VbCrLf
Set objErrMail= Server.CreateObject("CDO.Message")
.From = MyEmailFrom
.To = "firstname.lastname@example.org"
.Subject = "Wedding Website Enquiry"
.TextBody = MyBody
.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25