|
|
|
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("you@yourmail.com", $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 | | | a function that builds an HTML select list from any mysql table. Categories : PHP, MySQL, HTML and PHP | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | email new items in db Categories : PHP, Email, Databases, MySQL, Beginner Guides | | | Alternating background color for HTML table rows Categories : PHP, Databases, MySQL, HTML and PHP | | | Constantly refresh your PHP/HTML page data. Categories : PHP, HTML and PHP, Sybase | | | background music script for random notes in a frame Categories : PHP, Content Management, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Random Image Display Categories : PHP, Filesystem, Graphics, HTML and PHP | | | PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and 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.
| |
|
|
|