...

View Full Version : Java email script



bsharif
05-18-2007, 03:17 PM
Good morning to all, I need a script that I could use to send an email from the user to my personal email account. Basically I want the user to fill out a series of text boxes, name, message, subject and then once the user clicks the submit button the information will be sent to me via email from the site.

Philip M
05-18-2007, 03:53 PM
You need a server-side script such as formmail.pl for that. The best that JavaScript can do is validate the content of your textboxes before the form is submitted.

smalldog
05-18-2007, 03:54 PM
Hi bsharif, you need ASP or PHP script to do that, or you can use form with mailto target, but that is not the best solution.



<form method="post" action="mailto:info@dot.com">
Name: <input type="text" size="10" maxlength="40" name="name"> <br />
Subject: <input type="text" size="10" maxlength="10" name="subject"><br />
<textarea name="message"></textarea><br />
<input type="submit" value="Send">
</form>

bsharif
05-18-2007, 04:35 PM
Hi bsharif, you need ASP or PHP script to do that, or you can use form with mailto target, but that is not the best solution.



<form method="post" action="mailto:info@dot.com">
Name: <input type="text" size="10" maxlength="40" name="name"> <br />
Subject: <input type="text" size="10" maxlength="10" name="subject"><br />
<textarea name="message"></textarea><br />
<input type="submit" value="Send">
</form>



Thanks for the code , If I were to do it in Asp/php could you give me the code for that?

bsharif
05-18-2007, 04:44 PM
You need a server-side script such as formmail.pl for that. The best that JavaScript can do is validate the content of your textboxes before the form is submitted.

Your right, didn't even think about this!

smalldog
05-18-2007, 05:02 PM
Look here..

http://www.ibdhost.com/contact/

Philip M
05-18-2007, 05:20 PM
As I say, mailto: is very unreliable for several reasons and is not recommended. Using mailto: with forms produces inconsistent results in different browsers. Some will send the form directly. Some will open the associated default email program and ignore the form content completely. If there is no email program then the form will be completely non-functional. (Internet cafes, libraries etc will normally only allow web access and not email).

Use a server-side script (Perl or PHP) if you want it to work in all browsers.

bsharif
05-18-2007, 07:58 PM
Look here..

http://www.ibdhost.com/contact/

^^ Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum