WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder



Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Simple form mail - process your whole contact form.
Categories : PHP, Email, HTML and PHP Click here to Update Your Picture
Olaf Lederer
Date : Dec 08th 2004
Grade : 3 of 5 (graded 4 times)
Viewed : 8485
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Olaf Lederer
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

This short snippet will process your whole contact form. Just use the code in your (external) script and change the mail address. Tip: Use clear field names in your form. In the current version is the Mime-format supported.

<?php
$goto_after_mail
= "thanks.htm";

//ver 1.10 added some headers, incl. Mime mail to be accepted by more mail servers
$from_mail = $_REQUEST['from_email'];
$from_name = $_REQUEST['from_name']; // use both value's on you form
$header = "From: \"$from_mail\" <$from_name>\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Mailer: Olaf's formmail version 1.10\r\n";
$header .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$header .= "Content-Transfer-Encoding: 8bit\r\n";
$subject = "your webform posted at".date("d-m-Y"); //your mailsubject incl. current date
foreach ($_REQUEST as $key => $val) {
    if (
$key != "from_email" && $key != "from_name") { //skip, this values are already in the header
       
$body .= $key . " : " . $val . "\r\n";
    }
}
mail("[email protected]", $subject, $body, $header);
header("Location: ".$goto_after_mail);
?>



PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use!
Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP
PHP3 PHP POP3 SMTP MAIL
Categories : PHP, Email, HTML and PHP
PHP MultiList Mailing List Manager
Categories : Email, HTML and PHP, PHP
phpEasyMail: An easy way to send data from HTML-forms via EMail.
Categories : Email, HTML and PHP, Complete Programs, PHP
imap_subscribe -- Subscribe to a mailbox
Categories : PHP, PHP Functions, IMAP, Email
PHP based HTML rabbing Tools
Categories : PHP, HTML and PHP, Tag Extractors, Regexps, Beginner Guides
HTTP Basic Authentication via POP3.
Categories : Authentication, HTTP, Email, PHP
Local-to-user date and time display regardless of time zone or where the website's server is located
Categories : PHP, Date Time, HTML and PHP, Java Script
php table decoder used to convert an html table to individual tokens through regular expressions
Categories : PHP, Regexps, HTML and PHP
Convert date's in YYYY-MM-DD (i.e. mysql format) into PHP3 timestamps. Also Find the difference in days between two PHP3 timestamps.
Categories : HTML and PHP, PHP, MySQL, Date Time
Save time debugging PHP3 under UNIX/Linux using linked .phps files
Categories : HTML and PHP, Debugging, PHP
Customer feedback or simple emailer - A PHP script that enables your visitors to send you emails.
Categories : PHP, Email, Form Processing
Parsing html tags with php. Get an array from this function
Categories : PHP, HTML and PHP, Arrays, Tag Extractors
This is a redirection program which is as good as the come.to v3 url redirection, complete with admin interface all clients stored in mysql
Categories : PHP, MySQL, Ecommerce, HTML and PHP, Complete Programs
PHP and MySQL scripting for Muyltiple CheckBoxes
Categories : HTML and PHP, MySQL, Databases, PHP
 Jose Santos wrote : 1250
Where is the form ???
If you need send a mail with specify formats or, send a mail with cristhmas wallpalper as background, you may to use HTML format. 
It is very used from business to newsletters, letters, ...
And for this you need to use $header .= "Content-Type: text/html\r\n";
And if you can the mailer is the php, you can add $header .= "Mailer: Php ".php_version()."\r\n";
 
 Olaf Lederer wrote :1255
This simple example is for those people who needs a mail script to process f.e. a contact form. The form is not supported here... and it is not mail application it is form processor.