Check for valid email in JMail form

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 5th, 2006, 03:48
New Member
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote

  #2 (permalink)  
Old Apr 5th, 2006, 19:43
Up'n'Coming Member
Join Date: Mar 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Re: Check for valid email in JMail form

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
Reply With Quote
Reply

Tags
check, valid, email, jmail, form

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 15:32.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43