Encoding Issues
Posted: Thu Jan 22, 2004 9:36 am
Hi guys, can someone help me with this little issue I've got.
I have a system on my website where members can recieve a word file monthly. The PHP process that sends out the emails with the word attachment uses the PEAR Mime classes.
Every month however I get about four or five emails ( out of about 70 members, although I dont know how many dont bother to inform me of any problems ) stating that the email they recieved was a load of jumbled text instead of the attachment.
The attachemnt is sent fine to my email address, and to friends who use different email clients than me. My code is as follows
Does anyone know why these odd couple of customers recive unencoded attachments. Or why when I physically attach the file via outlook express and send it to the aforementionned customers it is recieved perfectly?
I have a system on my website where members can recieve a word file monthly. The PHP process that sends out the emails with the word attachment uses the PEAR Mime classes.
Every month however I get about four or five emails ( out of about 70 members, although I dont know how many dont bother to inform me of any problems ) stating that the email they recieved was a load of jumbled text instead of the attachment.
The attachemnt is sent fine to my email address, and to friends who use different email clients than me. My code is as follows
Code: Select all
<?php
$mail_to = $row['email'];
$mail_subject = "BlahBlah"
$mail_body = "Dear So and So etc etc \r\n\r\n";
$mail_body .= "Yours Sincerely\r\n\r\n";
$catalogue_filename = "../Catalogues/" . $_POST['SaleNumber'] . ".doc";
$hdrs = array('From' => 'blahblah@blahblah.com','Subject' => $mail_subject);
$crlf = "\r\n";
$mime = new Mail_mime($crlf);
$mime->setTXTBody($mail_body);
$mime->addAttachment($catalogue_filename,"application/msword");
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send($mail_to, $hdrs, $body);
?>