473,232 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,232 software developers and data experts.

Problem with Pear Mail_Mime

I've got an interesting problem that I just have not been able to
figure 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 = 'w********@xxxxxxxx.com';

/// MAKE "HEADERS" ARRAY AND POPULATE///////////////////
$headers['From'] = 'i***@xxxxxxxxxxx.com';
$headers['Subject'] = 'Mailing Test';

//////////// CREATE MIME OBJECT //////////////////
$mime = new Mail_mime();

//////// ADD BODY PARTS ////////////////////////////
$text = 'Text Version of Email';

$html = '<html><body>HTML version of email</body></html>';

$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

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: <xx*@xxxx.net>
Delivered-To: 1-*********@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: <20************************@xxxxxxx.net>
To: we*******@xxxxxxx.com
Subject: Mailing Test
MIME-Version: 1.0
From: in**@xxxxxxxx.com
Content-Type: multipart/alternative;
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on
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,

Sep 21 '05 #1
1 3305
George wrote:
The full headers of the email are as follows:


Stab in the dark: there are extra CRLFs between each body part's
headers, leaving MUAs to interpret them as data instead of headers.
Each alternative would then take on default values, and recipients
would therefore be presented with a text/plain version. This would
also account for the body part's headers occurring as data.

But let's see each body part's headers as well, the headers that
accompany each alternative in your multipart message, if there are
any. That might shed some light. Better still, let's see an entire
message, preferably reduced to a bare minimum, which exemplifies the
problem. (Ctrl+U in Firebird gives access to the source.)

Sep 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Weston C | last post by:
I'm having some trouble with Mail_Mime... it looks as if it isn't handling the creation of headers transparently. Here's what I'm essentially doing: $MimeMesg = new Mail_mime();...
by: Jerry | last post by:
Hi People ! I have an Urgent Problem and greatly appreciate your help: My script sends multipart emails using the MAIL_MIME package from pear.php.net Works great so far but..... ...
by: Jan Holland | last post by:
I am trying to install pear on a shared server/host following the instructions from: <http://uk.builder.com/architecture/web/0,39026570,20283197,00.htm> So I made a subdir on my site like:...
by: junkmail | last post by:
on a win 2k server apparantly it is saying i dont have it. or it cant find it. im using mySQL 4.1 php 4.3.x apache 3.0.53 im new to php and am doing some tutorials, but when i run the sripts...
by: praba kar | last post by:
Dear All, email.Message module base we can build message for mailing services which is like php Mail_mime module. In php Mail_mime module willautomatically build all the header fields like...
by: Alan Prescott | last post by:
I'm running SuSE Linux 9.3, fully up to date running # pear install db responds with ... downloading DB-1.7.6.tgz ... Starting to download DB-1.7.6.tgz (124,807 bytes)...
by: metin | last post by:
When I want to install php after the commands ../configure --with-apxs2=/www/bin/apxs --with-mysql and make without any error, when i type make install i have the following error: Installing...
by: P | last post by:
Hello, I have some trouble with my application. It is written with PEAR, SMARTY .... I should send an email to me and with Bcc to 50's else adresses. But it send it just to me. I am on an...
by: daniyalnawaz | last post by:
Hi! Im trying to send a html mail through PEAR but what I get in mail is blank email. Below is my code require_once "Mail.php"; require_once "Mail\mime.php";
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.