943,915 Members | Top Members by Rank

Ad:
Jul 3rd, 2009
0

How do i make a form that doesn't open the e-mail client?

Expand Post »
i've made a website with a contact form, but everytime you click the send button it opens the computer default e-mail client. i know there is a way of doing this, but i dont know how.

I think it involves php and if it does can somebody show me how to do it, in simple terms (because i'm new to php),

HTML and CSS Syntax (Toggle Plain Text)
  1. <form action="mailto:mail@address.com" method="post" name="contact" id="contact">
  2. <table width="648" border="0" align="center">
  3. <tr>
  4. <td width="329" align="right"><div align="right">Title:</div></td>
  5. <td width="10" align="right">&nbsp;</td>
  6. <td width="300"><div align="left">
  7. <select name="title" id="title">
  8. <option>-- Select One --</option>
  9. <option>Mr</option>
  10. <option>Mrs</option>
  11. <option>Miss</option>
  12. <option>Ms</option>
  13. </select>
  14. </div></td>
  15. </tr>
  16. <tr>
  17. <td align="right"><div align="right">First Name:</div></td>
  18. <td align="right">&nbsp;</td>
  19. <td><div align="left">
  20. <input type="text" name="firstName" id="firstName">
  21. </div></td>
  22. </tr>
  23. <tr>
  24. <td align="right"><div align="right">Last Name:</div></td>
  25. <td align="right">&nbsp;</td>
  26. <td align="left"><div align="left">
  27. <input type="text" name="lastName" id="lastName">
  28. </div></td>
  29. </tr>
  30. <tr>
  31. <td align="right">&nbsp;</td>
  32. <td align="right">&nbsp;</td>
  33. <td>&nbsp;</td>
  34. </tr>
  35. <tr>
  36. <td align="right"><div align="right">Telephone:</div></td>
  37. <td align="right">&nbsp;</td>
  38. <td><div align="left">
  39. <input name="phone" type="text" id="phone" size="51">
  40. </div></td>
  41. </tr>
  42. <tr>
  43. <td align="right"><p align="right">E-Mail:</p></td>
  44. <td align="right">&nbsp;</td>
  45. <td><div align="left">
  46. <input name="e-mail" type="text" id="e-mail" size="51">
  47. </div></td>
  48. </tr>
  49. <tr>
  50. <td align="right"><div align="right"></div></td>
  51. <td align="right">&nbsp;</td>
  52. <td><div align="left"></div></td>
  53. </tr>
  54. <tr>
  55. <td align="right"><div align="right">Reason for Contacting:</div></td>
  56. <td align="right">&nbsp;</td>
  57. <td><div align="left">
  58. <select name="reason" id="reason">
  59. <option>-- Select One --</option>
  60. <option>General Enquiry</option>
  61. <option>Tips</option>
  62. <option>Commisioning</option>
  63. <option>Website Fault</option>
  64. </select>
  65. </div></td>
  66. </tr>
  67. <tr>
  68. <td align="right"><div align="right"></div></td>
  69. <td align="right">&nbsp;</td>
  70. <td><div align="left"></div></td>
  71. </tr>
  72. <tr>
  73. <td align="right" valign="top"><div align="right">Enquiry:</div></td>
  74. <td align="right">&nbsp;</td>
  75. <td><div align="left">
  76. <textarea name="enquiry" cols="48" rows="5" wrap="physical" id="enquiry"></textarea>
  77. </div></td>
  78. </tr>
  79. <tr>
  80. <td align="right" valign="top"><div align="right">
  81. <input type="submit" name="send" id="send" value="Send" a href="Contact.html" onClick="alert("You will now be redirected to your e-mail client")">
  82. </div></td>
  83. <td align="right">&nbsp;</td>
  84. <td><div align="left">
  85. <input type="reset" name="clear" id="clear" value="Clear">
  86. </div></td>
  87. </tr>
  88. </table>
  89. <label></label>
  90. <p>
  91. <label></label>
  92. </p>
  93. </form>

Need help ASAP please
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Atomika3000 is offline Offline
40 posts
since Apr 2009
Jul 3rd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

where do you want to send your information?
Reputation Points: 45
Solved Threads: 1
Junior Poster
stevenpetersen is offline Offline
132 posts
since Jun 2009
Jul 3rd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

Right now you are using a mailto tag as the action for your form. If you want to use php, you need to have a php file as the action and use that php file to handle the information.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Magicianer is offline Offline
12 posts
since Jul 2009
Jul 3rd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

ok, it doesn't have to be php, all it has to do is send it to a specified e-mail address without opening the users default e-mail client and then needing them to press send.

If the only way is php, then so be it
Reputation Points: 10
Solved Threads: 0
Light Poster
Atomika3000 is offline Offline
40 posts
since Apr 2009
Jul 3rd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

php is easiest using the mail() function. You can format the email message however you like.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Magicianer is offline Offline
12 posts
since Jul 2009
Jul 3rd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

You can do it pretty easily in PHP with the mail() function. To do this though you would need to change the action attribute on your form tag to your PHP script. Then construct the message in PHP and use the mail() function to send it. For more on mail() see W3Schools and the PHP.net Reference.
Reputation Points: 47
Solved Threads: 47
Posting Whiz
FlashCreations is offline Offline
393 posts
since Sep 2008
Jul 22nd, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

You'd need to change your line to
HTML and CSS Syntax (Toggle Plain Text)
  1. <form action="filename.php" method="post" name="contact" id="contact">

the php code is in a separate file, a text file is what i use.

If you happen to host the site on godaddy, then have a basic php form already written and ready to use.

Otherwise you can start here
http://www.w3schools.com/php/php_forms.asp
Reputation Points: 10
Solved Threads: 0
Newbie Poster
bbqkaren is offline Offline
20 posts
since Oct 2006
Jul 29th, 2009
0

Re: How do i make a form that doesn't open the e-mail client?

HTML and CSS Syntax (Toggle Plain Text)
  1. action="none"
Reputation Points: 730
Solved Threads: 181
Nearly a Senior Poster
MidiMagic is offline Offline
3,314 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Checklist for CSS problems
Next Thread in HTML and CSS Forum Timeline: multi column lists





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC