|  | Posted by George on 09/22/05 02:21 
I've got an interesting problem that I just have not been able tofigure out.  I'm trying to use Mail_Mime to send multi-part/mixed
 emails from a Linux server and I am having trouble getting everything
 to work together correctly.  I recently migrated this client from one
 Linux server to another, and unfortunatley have no access to the old
 server to figure out what has changed or is different between the two.
 Needless to say, the email used to work perfectly on the old server,
 and doesn't on the new.  What's happening is that the email is not
 being decoded by Outlook or Thunderbird, but looks perfectly fine when
 viewed through Horde.  The attachments are even being converted into
 garbage.  I tried using this script, just to test what was happening,
 and that's when I decided it was time to see if anyone else had
 experienced something similar.
 
 The script I tested with is:
 
 $to = 'webmaster@xxxxxxxx.com';
 
 /// MAKE "HEADERS" ARRAY AND POPULATE///////////////////
 $headers['From'] = 'info@xxxxxxxxxxx.com';
 $headers['Subject'] = 'Mailing Test';
 
 //////////// CREATE MIME OBJECT //////////////////
 $mime = new Mail_mime();
 
 //////// ADD BODY PARTS ////////////////////////////
 $text = 'Text Version of Email';
 $mime->setTXTBody($text);
 
 $html = '<html><body>HTML version of email</body></html>';
 $mime->setHTMLBody($html);
 
 //////// GET MIME FORMATTED BODY AND HEADERS////////////
 $body = $mime->get();
 $headers = $mime->headers($headers);
 
 $message =& Mail::factory('mail');
 $message->send($to, $headers, $body);
 
 
 As you can see, very simple.  Outlook is displaying the email as this
 though:
 
 Content-Type: text/plain; charset="ISO-8859-1"
 
 Content-Transfer-Encoding: 7bit
 
 
 
 Text Version of Email
 
 
 With no hint of the rest of the email message.  The full headers of the
 email are as follows:
 
 Return-Path: <xxx@xxxx.net>
 Delivered-To: 1-webmaster@xxxxxxx.com
 Received: (qmail 19972 invoked by uid 48); 21 Sep 2005 19:09:48 -0400
 Date: 21 Sep 2005 19:09:48 -0400
 Message-ID: <20050921230948.19939.qmail@xxxxxxx.net>
 To: webmaster@xxxxxxx.com
 Subject: Mailing Test
 MIME-Version: 1.0
 From: info@xxxxxxxx.com
 Content-Type: multipart/alternative;
 boundary="=_266f5fac0772f41edd2f26172b50fc69"
 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on
 xxxxxxxxxx.net
 X-Spam-Level:
 X-Spam-Status: No, hits=0.8 required=5.0 tests=HTML_20_30,HTML_MESSAGE,
 NO_REAL_NAME autolearn=no version=2.63
 
 
 Does anyone have any idea what I might be doing incorrectly or what
 settings in the qmail/mail or php.ini I should be looking for to
 correct this problem?
 
 Thanks in advance,
 George
  Navigation: [Reply to this message] |