Technical Support: Adding Mail to a Form

<BACK TO MAIN TECHNICAL MENU>

A web page form can capture text and send it to an email address. This section shows how to implement a form to email script.

 

Adding Email To A Form
If you want to place a series of text boxes on a form and then email the text in the boxes to your email address, then add the following code to your HTML document.

Note: You must prompt the user to enter their Full Name and Email address as this information is NOT automatically obtained. If you don't do this then you have no way of determining where the information came from.

Parameter names passed to mailgate are case-sensitive. Parameters "recipient", "subject" and "redirect" must be in lower-case.


<FORM METHOD="POST" ACTION="http://mailgate.server-mail.com/cgi-bin/mailgate"> 
<input type=hidden name="recipient" value="sales@acme.com.au"> 
<input type=hidden name="subject" value="Enter Subject"> 
<input type=hidden name="redirect" value="http://www.acme.com.au/feedback.htm"> 
Your Email address: <input type=text name="email"><BR> 
Your Full Name: <input type=text name="realname"><BR>  
Tell me what you think of me?  
<TEXTAREA NAME= "comments" ROWS=3 COLS=50>Type Here</TEXTAREA> 
<INPUT TYPE="SUBMIT" VALUE="Send Comments"> 
</FORM>
Line-1: Do not change.
Line-2: Replace sales@acme.com.au with your email address.
Line-3: Replace Enter Subject with the text that you want to have appearing when the data is emailed to you.
Line-4: Replace http://www.acme.com.au/feedback.htm with the name of the page that you want to return to, after the form has been processed.
Line-5: Do not change this line as it asks the user for their email address. The message that is sent to the email address in line 2 will appear to have come from this email address.
Line-6: Do not change this line as it asks the user for their Real Name. The message that is sent to the email address in line 2 will list this as the user's Real name.
Line-7&8: Creates a scroll box which lets the user enter data. This data will be emailed to the address listed in line 2. You can add more text and more textboxes in this section to gather other information from the user.
Line-9: Places a button on the screen. Replace Send Comments with any text that you want to have displayed on the button.
Line-10: Do not change.

 

<BACK TO MAIN TECHNICAL MENU>