sending mail with pdf attachment
| From: | Merlin | Date: | Thu, 17 Apr 2003 14:48:00 +0000 |
| Subject: | sending mail with pdf attachment | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-144291@lists.php.net to get a copy of this message | ||
Hi there,
I would like to send email with php mail function incuding a pdf attachment.
After playing around with it and several searches on google I am stuck. The
mail is delivered, and the attachment contains plain text (the message).
Maybe someone can give me a small hint. I guess it can't be that hard to
send an pdf attachment ??!!
Thanx,
Merlin
// send mail with attachment
function my_mail3($to,$subject,$message,$from){
$mailHeaders = "From: ".$from."\n"; // from
$mailHeaders .= "X-Mailer: PHP\n"; // mailer
$mailHeaders .= "Return-Path: <".$from.">\n"; // Return path for errors
$mailHeaders .= "MIME-Version: 1.0\r\n";
$mailHeaders .= "Content-Type: application/pdf; name=test.pdf;
Content-Disposition: attachment; Content-Transfer-Encoding:
quoted-printable\r\n";
#$headers .= "X-Attach my_file_path";
$body = $message;
if (mail($to, $subject, $body, $mailHeaders) ){
return true;
}
else{
return false;
};
}