This is a discussion on "Check for valid email in JMail form" within the Classic ASP section. This forum, and the thread "Check for valid email in JMail form are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Check for valid email in JMail form
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Check for valid email in JMail form
I have a very simple form that I want to use to send visitor email addresses thru JMail. I am struggling with trying to validate the submitted email. The script I am currently using is working to a point...it gives an error message if the field is left empty but it is sending it through if it is only partially filled out. I know this should be easy.
The script I am using is below: <%language=vbscript%> <% response.buffer = true%> <body> <% On Error Resume Next Set JMail = Server.createobject ("JMail.SMTPMail") JMail.ServerAddress = "mail.sombody.com" If Request.Form ("e_m_a_i_l") = "" Then %> <b>The system could not process your request, this is due to an invalid email address. Please check your address, if you know this address to be correct; please contact the <A HREF="mailto:somebody@domain.net">Webmaster.</A> </b> <P> <b>Please use your browsers back button to return to the registration page. <% Else JMail.Sender = Request.Form ("e_m_a_i_l") JMail.Subject = "Guest sign up for *******" JMail.AddRecipient "somebody@domain.net" messagebody = "Submitted On: " & Date & chr(13) messagebody = messagebody & "Email Address: " & Request.Form ("e_m_a_i_l") & chr(13) JMail.Body = messagebody JMail.Priority = 3 JMail.Execute <<it seems to be working great up to this point>> If Err.number <> 0 Then %> </b> <b> The system could not process your request. This is more than likely due to an invalid email address. Please check your address, if you know this address to be correct; please contact the <A HREF="mailto:somebody@domain.net">Webmaster. </A></b> <P> <% Else %> <B>Thank you for your interest in *****. By registering as our guest you will receive our newsletter and notification of new products, sales events and specials!</B> <P><B>Please use your browsers back button to return to the ****** Web site. </B> <P> <P> <% End If End If %> </body> </html> You can view the actual "send" button at: http://www.specsaroundtown.com/default2.htm I am a newbie to this forum so please forgive me if I have done something wrong in my post. Thanks, palgraphpres |
|
|
|
|||
|
Well the best way is to verify everything. Heres a nice little article on validating an email. I haven't used it (haven't ventured in to the emailing part...) so be sure to tell me if everything goes well.
http://coveryourasp.com/ValidateEmail.asp ps May have sent you a bum address sorry. Could help but click the button |
![]() |
| Tags |
| check, valid, email, jmail, form |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Check for email. | Jack Franklin | PHP Forum | 22 | Feb 6th, 2008 12:59 |
| ASP form to check weather a form value is already in the database | Andrew1986 | Classic ASP | 3 | Oct 25th, 2007 08:23 |
| PHP email form not sending email | Kurt | PHP Forum | 1 | Oct 12th, 2007 04:26 |
| Form submits to email via php, but email is blank!!?? | DH1234 | PHP Forum | 2 | Jun 18th, 2007 10:42 |
| EMail Form | Sabin_33 | JavaScript Forum | 12 | Dec 4th, 2006 16:20 |