Friday, September 20, 2013
HTML FORM MAIL SENDING WITH HTML STRUCTURE AND CSS WITH TECTITE FORMMAIL
Friday, September 20, 2013 by Unknown
Hiii, in my previous post HTML Form mail sending with HTML structure and CSS , I had given a demo of how to send the contents <input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=Bio-data1_first.htm, Exclude=email;realname;” />or fields of form in a mail in HTML format with CSS with the help of PHP mail() Function. But there is some limitation in that method i.e. it requires more work to be done for proper HTML structure and it can cause difficulty if the form is very big . So. here in this post I’ll give you another demo with some other method to overcome that problem. We are using Tectite formMail in this demo.
Tectite form mail is very easy and it works by just adding some hidden fields in the form and just adding a form action to file namely ‘formmail.php’ in your form file.
Your can download formmail.php file from here.
Your can download formmail.php file from here.
Demo Begins :
Suppose the form given below is your normal form .
<form action=”" method=”POST” name=”form1″>
<input type=”text” name=”fname” placeholder=”First Name”>
<input type=”text” name=”age” placeholder=”Age”>
<input type=”text” value=”submit”>
</form>
<form action=”" method=”POST” name=”form1″>
<input type=”text” name=”fname” placeholder=”First Name”>
<input type=”text” name=”age” placeholder=”Age”>
<input type=”text” value=”submit”>
</form>
then to make it in a format for automatic mail sending on submit , add the following fields in your form :
–> <input type=”hidden” name=”env_report” value=”REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER” />
–> <input type=”hidden” name=”recipients” value=”you@your-host-name.com” /> //specifyong the recepients address
–> <input type=”hidden” name=”subject” value=”Sample FormMail Testing” /> //specifying subject or you mail
–> <input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, Exclude=email;realname;” />
–> <input type=”hidden” name=”env_report” value=”REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER” />
–> <input type=”hidden” name=”recipients” value=”you@your-host-name.com” /> //specifyong the recepients address
–> <input type=”hidden” name=”subject” value=”Sample FormMail Testing” /> //specifying subject or you mail
–> <input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, Exclude=email;realname;” />
and make the form tag action to formmail.php as shown below :
<form method=”post” action=”http://www.your-host-name.com/formmail.php” name=”form1″>
<form method=”post” action=”http://www.your-host-name.com/formmail.php” name=”form1″>
I you wanna add some template to the form data which you wanr to send in mail then make that template file (.htm) in some folder and mention tha name of the folder and template name in the “mail_options” hidden input field above as shown below :
<input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=example.htm, Exclude=email;realname;” />
Here in this hidden input field, example.htm is my template for this form.
<input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=example.htm, Exclude=email;realname;” />
Here in this hidden input field, example.htm is my template for this form.
then your final form will look like :
<form method=”post” action=”http://www.your-host-name.com/formmail.php” name=”form1″>
<input type=”hidden” name=”env_report” value=”REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER” />
<input type=”hidden” name=”recipients” value=”you@your-host-name.com” />
<input type=”hidden” name=”subject” value=”Sample FormMail Testing” />
<input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=example.htm, Exclude=email;realname;” />
<input type=”text” name=”fname” placeholder=”First Name”>
<input type=”text” name=”age” placeholder=”Age”>
<input type=”text” value=”submit”>
</form>
<input type=”hidden” name=”env_report” value=”REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER” />
<input type=”hidden” name=”recipients” value=”you@your-host-name.com” />
<input type=”hidden” name=”subject” value=”Sample FormMail Testing” />
<input type=”hidden” name=”mail_options” value=”CharSet=UTF-8, HTMLTemplate=example.htm, Exclude=email;realname;” />
<input type=”text” name=”fname” placeholder=”First Name”>
<input type=”text” name=”age” placeholder=”Age”>
<input type=”text” value=”submit”>
</form>
Working with templates :
1. Create a HTML_template folder in the directory where your form file and formmail.php is placed.
2. Create a template file (.htm) file in that folder , in my case it is example.htm. the example.htm files contain a code like this :
2. Create a template file (.htm) file in that folder , in my case it is example.htm. the example.htm files contain a code like this :
<html>
<head><title>MY FROM</title>
<style type=”text/css”>
//Your custom CSS
</style>
</head>
<body>
<table>
<head><title>MY FROM</title>
<style type=”text/css”>
//Your custom CSS
</style>
</head>
<body>
<table>
<tr>
<td>NAME</td>
<td width=”20%”>$fname</td>
<td>NAME</td>
<td width=”20%”>$fname</td>
</tr>
<tr>
<td>AGE</td>
<td>$age</td>
</tr>
</table>
</body>
</html>
<tr>
<td>AGE</td>
<td>$age</td>
</tr>
</table>
</body>
</html>
after “$” in the above code, the name of the input field in form is written whose value you have to use there. Our form has only two input fields namely “fname” and “age” so I have used these two.
3. Specify the folder name of HTML Template in formmail.php on line 347 on expression like : $TEMPLATEURL = $SCHEME.$SERVER.”/HTML_template”;
4. Specify target/ recipient mail at line 263 on expression like : $TARGET_EMAIL = array(“^email@example\.com$”);
Hope you like this post……..Please Comment....!!!!!!
Originally posted at Mycodestock.
Tags: HTML , PHP
Subscribe to:
Post Comments (Atom)
0 Responses to “HTML FORM MAIL SENDING WITH HTML STRUCTURE AND CSS WITH TECTITE FORMMAIL”
Post a Comment