Mail with Word attachment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I need to send MS Word attachments from PHP (they're built on the fly).

I've tried PHPMailer but that doesn't like my NT box so I've gone back to
php's mail() function.

I'm using the following script but and the attachment is in the same
webfolder as the script but when I check the email, the attachment is
there - but blank.


$border="--==================_856811060==_";
$recipient = "george.pitcher@ingenta.com";// . ", ";
$subject = "Birthday Reminders for August";
$message = "$border\n";
$message .= "Content-Type: text/plain; charset=us-ascii;format=flowed\n";
$message .= "The following email includes a formatted ASCII table\n";
$message .= "Day \t\tMonth \t\tYear\n";
$message .= "3rd \t\tAug \t\t1970\n";
$message .= "17rd\t\tAug \t\t1973\n";
$message .= "$border\n";
$headers = "From: Birthday Reminder <birthday@php.net>\n";
$headers .= "X-Sender: <birthday@php.net>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "Return-Path: <birthday@php.net>\n"; // Return path for errors
$headers .= "Mime-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$border\"\n";
$headers .= "Content-Type: application/msword; name=\"Introduction.doc\"\n";
$headers .= "Content-Transfer-Encoding: base64\n";
$headers .= "Content-Disposition: attachment;
filename=\"Introduction.doc\"\n";
mail($recipient, $subject, $message, $headers);

Any suggestions?

George in Oxford

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux