Send mail atachment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcoelho123
Forum Commoner
Posts: 37
Joined: Tue Jun 06, 2006 6:27 am

Send mail atachment

Post by mcoelho123 »

I guys...
Now i have this to send an email

Code: Select all

$to = $to2;

$message = "<html><head><title></title></head><body>" . nl2br($message) . "</body></html>";

// To send HTML mail, the Content-type header must be set

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: ' . $to2 . "\r\n";
$headers .= 'From: NET' . "<" . $from . ">" . "\r\n";
// $headers .= 'Cc: ' . "\r\n";
// $headers .= 'Bcc: ' . "\r\n";
 
mail($to, $subject, $message, $headers) or die("Email error");
}
What do i need to change to send an atachment (with $_FILES)??

Thanks in advance
Post Reply