HTML Form mail sending with HTML structure and CSS with Tectite FormMail

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.

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>

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;” />

and make the form tag action to formmail.php as shown below :
<form method=”post” action=”http://www.your-host-name.com/formmail.php&#8221; 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.

then your final form will look like :

<form method=”post” action=”http://www.your-host-name.com/formmail.php&#8221; 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>

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 :

<html>
<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>

</tr>
<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…………!!!!!!!!!

About these ads

2 thoughts on “HTML Form mail sending with HTML structure and CSS with Tectite FormMail

  1. Thanks for ones marvelous posting! I quite enjoyed reading it, you could be a
    great author.I will ensure that I bookmark your
    blog and will come back in the future. I want to encourage you to ultimately continue your great work, have a nice
    holiday weekend!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s