Forum Moderators: coopster
[edited by: encyclo at 1:26 am (utc) on June 12, 2009]
[edit reason] no links to personal sites please [/edit]
Handling file uploads, PHP.net [us2.php.net]
Right now when it post to the email account receiving this data it is not in a nice format.
You need to generate HTML emails. Basically you compose an HTML page.
Then when sending the mail, you need to include the content-type:text/html header.
$email_subj="Thank You For Your Order";
$text ="
<html></head><title>Test email</title></head>
<body>
<p>Dear $fname,</p>
<p>Here is your order.<p>
<table width="65%" align="center">
<tr><td>Name:</td><td>$fname $lname</td></tr>
<tr><td Total:</td><td>\$$total</td></tr>
</table>
";
$headers = "From: $from\r\n"; // Preformat as "company" <email>
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $email_subj, $text, $headers);
You most likely will want to attach the uploaded file to the email - PHP mail [us.php.net]
Email with attachments and special types of content (e.g. HTML) can be sent using this function. This is accomplished via MIME-encoding - for more information, see this » Zend article [zend.com] or the » PEAR Mime Classes [pear.php.net].