Check this out:
http://xtrax.ro/php/mail/mail.php
<?php
$sBody="<table align=\"center\" border=\"1\">\n";
for ($iCount=1;$iCount<=8;$iCount++){
$sField="field$iCount";
$sBody=$sBody."<tr><td align=\"right\">Field $iCount</td><td align=\"left\">".$$sField."</td></tr>\n";
}
$sBody=$sBody."</table>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$sBody="<html><head><title>$search_name</title></head><body>".stripslashes($sBody)."</body></html>";
$sendmail=mail("$txtEmail", "The subject", stripslashes($sBody), "From: nelutu@@zalau.astral.ro\r\n". $headers);
echo "sendmail:$sendmail<BR />";
echo $sBody;
?>
// updateDB.inc.php
<?php
$server = 'localhost'; // MYSQL server;
$user = 'username'; // User to connect to MYSQL server;
$password = 'password'; // Password;
$database = 'database'; // The name of the database;
$yourtable= 'yourtable'; // The name of the table;
// mysql_connect ($server, $user, $password) or die ("Can't connect!");
// mysql_select_db ($database) or die ("Can't open database $database!");
// $reqSQL="INSERT INTO $yourtable VALUES ('$field1','$field2','$field3','$field4','$field5','$field6','$field7','$field8')";
// $result = mysql_query($reqSQL);
?>
// sendmail.inc.php
<?php
$sBody="<table align=\"center\" border=\"1\">\n";
for ($iCount=1;$iCount<=8;$iCount++){
$sField="field$iCount";
$sBody=$sBody."<tr><td align=\"right\">Field $iCount</td><td align=\"left\">".$$sField."</td></tr>\n";
}
$sBody=$sBody."</table>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$sBody="<html><head><title>$search_name</title></head><body>".stripslashes($sBody)."</body></html>";
$sendmail=mail("$txtEmail", "The subject", stripslashes($sBody), "From: nelutu@@zalau.astral.ro\r\n". $headers);
// echo "sendmail:$sendmail<BR />";
// echo $sBody;
?>