Send Mail with PHP, ASP, or Perl

The PHP option
Here is the PHP code, it doesnt almost the exact same thing the ASP code does. For those that skipped the ASP code, I'm assuming you are familiar with PHP and can use the comments in the code to follow. The PHP code was writen by Josh Musselwhite.
<?php //tells the server this is php
//-------------------------------------
// the below code set the headers. There can be a bit difficult to understand fully.
// Information about them and all the commands below can be found at the PHP manual
// NOTE TO ALL USERS - Gmail and some older server configs DO NOT like \r\n, just use \n with it comes to html emails.
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Your Websites Name Here <' . $_POST['email'] . '>' . "\r\n"; //you can put your websites name in here or anything else you like
//$headers .= 'Bcc: <a href="mailto:another@email.com'">another@email.com'</a> . "\r\n"; //this is optional.
//------------------------------
// gets variables from flash
$to = <a href="mailto:'your@email.address'">'your@email.address'</a> //inset the email address it goes to here
$subject = $_POST['subject_txt'];
$message = $_POST['message_txt'];
if ($_POST['message_txt'] != "") { //this checks to make sure someone didn't visit the page manually by making sure message_txt is not empty
$ok = mail($to, $subject, $message, $headers); //this line sends the mail and returns true or false
if($ok) {
echo "&server_mes=ok&"; //if mail was send print to the screen "&server_mes=ok"
} else {
echo "&server_mes=fail&"; // if mail was NOT sent, print to the screen "&server_mes=fail"
}
}
?>
Note, Gmail does not like the "\r\n" method of new lines, use "\n" instead.


