JMail: How can I deal with a bad e-mail address?
I test for basic problems in the email address such as @ sign and period in the previous page, but if the email is still bad, it fries the server when the email is sent by JMail. Here's the code I'm using. Thank you for your help.
On Error Resume Next
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.ServerAddress = "mail.ab-cpe.com:25"
JMail.Sender = "email@example.com"
JMail.Subject = "AB-CPE Information"
JMail.Body = "Password: "&Session("EntirePW")
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables ("REMOTE_ADDR")
If Err.number <> 0 Then
Response.write("Bad e-mail address.")
Response.write(âYour e-mail has been sent.â)
Mark J. Weisberger