[Typo3-dev] Html mail class and RFC 2111 Standard

Jan-Erik Revsbech jer at moccompany.com
Thu Apr 1 11:44:10 CEST 2004


I still have some problems with the class.t3lib_htmlmail class and some outlook email clients (although not all versions of outlook. Strange...) Anyway I looked up the standard for MIME messages containg HTML with embedded images. And typo3 does something wrong:


The RFC 2111 specifies that Message ids and Conent ids should be displayed as (See for instance: http://www.mhonarc.org/~ehood/MIME/rfc2111.txt)

Content-ID: SOMESTRING at DOMAIN.ORG

And in the HTML part the <img> tag should then read

<img src="cid:UNIQUESTRING at DOMAIN.ORG">

The class.t3lib_htmlmail class does this:

Content-id: <partNN.<THE_MESSAGE_ID>>

And then sets the HTML tags to <img src="cid:partNN.<THE_MESSAGE_ID>" />

The fix is simple requres only two subsitutions in the class:

-In function start:

Replace:   $this->messageid = '<'.md5(microtime()).'@domain.tld>';
with:    $this->messageid = md5(microtime()).'@domain.tld';

- In function setHeader()
Substitue   $this->add_header("Message-ID: $this->messageid);

with   $this->add_header("Message-ID: <".$this->messageid.">");


This will make it work and compliant with the standar.

I hope it will make it to the 3.6RC2

Keep up the good work
/Jan-Erik





More information about the TYPO3-dev mailing list