Free content for your website or blog
Home About Us Article Writing Most Read Articles Authors Blog Wiki Contact Us
RSS Register Login
Topics
 
Home > Webmasters >

How to make a simple form mailer with PHP

Date Published: 01st July 2005
Bookmark and Share Republish How to make a simple form mailer with PHP
Author: Rupe Parnell RSS Views: N/A PRINT ASK ABOUT THIS ARTICLE
As you may be well aware, displaying your e-mail address on your website can lead to e-mail harvesters picking up your address and adding it to hundreds or even thousands of lists used by spammers. If you want to allow your website visitors to contact you, but do not want to publicly display your e-mail address, then a form mailer may be exactly what you are looking for.

What is a form mailer? Quite simply, it is a form that you place on your website, that when filled in and submitted, sends you an e-mail with the contents. Below is an example of a simple form mailer written in PHP - feel free to change the information to that of your own website and make use of it:

[WRITE YOUR HTML HEADER HERE]


if ($_POST[t] == 'process'){

mail('webmaster@yoursite.tld','Your Site Contact Form Submission',stripslashes($_POST[message]),'FROM:'.$_POST[email]);


echo'

Thank you, your message was sent to the webmaster.

'."n";

} else {

echo'
'."n";
echo''."n";

echo'Your E-Mail Address:


'."n";

echo'Your Message:


'."n";

echo''."n";
echo'
';

}

?>

[WRITE YOUR HTML FOOTER HERE]

To clarify, copy and paste everything from [WRITE YOUR HTML HEADER HERE] to [WRITE YOUR HTML FOOTER HERE] into a text editor such as Notepad. Make your desired alterations. Save as a file with a .php extension (such as contact.php). Upload to your server and link to the file.
This article is free for republishing
Source: http://www.articlealley.com/article_2500_16.html
About the Author
Occupation: PHP developer
Rupe Parnell is the founder and lead developer at Starsol.co.uk, a website development and management firm located in Norfolk, England. Rupe specialises in creating professional grade PHP scripts, a selection of which are available free at Starsol Scripts.
Bookmark and Share
 

Related Articles

How To Accept Credit Cards Online

More Cool Sites Everyone Should Bookmark

Hits, Clickthroughs or Unique Visitors?

Sticky Sites Rule The Internet

Developing Netpreneur's Daily Profitable
A New Scam Hits The Web

7 Essential SEO techniques

Website Planning Can be a Sticky Situation

How To Avoid Hackers From Destroying You

Top 10 Webmaster Challenges
 

Ask a Question About this Article

>> Our kennel club is a not for profit. Our last ...
>> My wife wont make love to me
>> Legal forms
>> I hv round face.my hair length is upto shoulder. i ...
Powered by