Epicserve

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

November 01, 2006 | 10:15am 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.

Comments

1.   At 4:02am CST on November 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.
2.   At 9:41am CST on November 18, 2006, Brent O'Connor wrote:
BJ, Glad I could help!
3.   At 2:31am CDT on July 24, 2007, bash wrote:
i still can’t send html with embed images
seems like the images not encoded (?)
any hints?

Post Your Comment

(Optional & Not Displayed)

(Optional)


(allowed tags - strong, em, cite, & code)

remember me

Post Guidelines

Please be considerate of others. Keep comments relevant. Content deemed inappropriate or offensive may be edited and/or deleted. Email addresses are never displayed.

Line breaks and paragraphs are automatically converted — no need to use p or br/. Quotes, apostrophes, and double-dashes are automatically converted to smart punctuation. Be careful when copying and pasting portions of entries or other comments.

Links can be created using the standard <a href="http://url">urlName</a>. The following inline HTML elements may also be used: strong, em, cite, & code. The title attribute is allowed within any element. All other code will get removed before posting.

Latest Photos

Good Reading

A bunch of presentations on scaling websites: twitter, Flickr, Bloglines, Vox and more.
Good links and presentations I'm going through about scaling websites.
Upside-Down-Ternet
Now that's a good April fools joke!
Animator vs. Animation by Alan Becker
Pretty cool flash animation that a friend showed me.
30+ Useful Websites You Probably Didn't Know About
Looks like some good websites that could come in handy. The GetHuman website definitely sounds useful!

view past links