Fixing HTML Mime Mail so it works with php 4.4.x

November 1, 2006 | 10:15 a.m. CST

I recently migrated to a new web server at work that is running Ubuntu Server 6.06.1 LTS which has PHP 4.4.2. The old server was running PHP 4.3.10, so upgrading from PHP 4.3 to PHP 4.4 caused HTML Mime Mail to give notices when running in the website with error_reporting(E_ALL).

It took me awhile to debug the notices so I thought I would save someone else the trouble who might be googling for an answer. At any rate the following are the changes I had to make.

In RFC822.php add "$comments = array();" after line 566.

In htmlMimeMail.php on line 455 & 470 change the line to "$return = &$obj->addSubpart('', $params);" by adding a "&" in front of "$obj->".

In smtp.php change line 94 to the following:

$return = $this->auth ? $this->ehlo() : $this->helo();
return $return;

I would submit a patch to Richard Heyes the author but I didn't seen anywhere on his site that you could submit patches.

Related tags: PHP


1.   At 4:02 a.m. CST on Nov. 18, 2006, BJ wrote:

Thank you so much for this. It took me a whole evening figuring out, why I could not send HTML with embedded images.

Brent O'Connor
2.   At 9:41 a.m. CST on Nov. 18, 2006, Brent O'Connor wrote:

BJ, Glad I could help!

3.   At 2:31 a.m. CDT on July 24, 2007, bash wrote:

i still can't send html with embed images seems like the images not encoded (?) any hints?

Comments are closed.

Comments have been close for this post.