473,396 Members | 1,792 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,396 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';
$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: <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;
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

Sep 21 '05 #1
1 3310
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.)

--
Jock
Sep 23 '05 #2

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

Similar topics

0
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();...
9
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..... ...
3
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:...
3
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...
1
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...
2
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)...
0
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...
0
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...
7
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";
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.