[TYPO3-core] RFC: HTMLmail charset

Martin Kutschker Martin.Kutschker at blackbox.net
Sun Oct 23 19:54:20 CEST 2005

Bernhard Kraft <kraftb at kraftb.at> writes on 
Thu, 20 Oct 2005 14:17:53 +0200 (METDST):

> Martin Kutschker wrote:
> The method ->setCharset() can get called with the charset to use as
> argument from external or derived classes - but those will need to
> call ->setContentTypeHeader() to also set the headers.

Ok, but I think you should not use $GLOBALS['TSFE']->metaCharset but $GLOBALS['TSFE']->renderCharset for auto-detection auf the FE charset.

> > I don't understand the changes to dmailer_prepare, but calling a
> > constructor twice sounds like an ugly hack - and broken API.
> Well. The dmailer fetches a page from the FE. Where shall it know
> from in which charset this page is and how it has to get sent via
> mail ?
> The only possibility is to find the <meta http-equiv="Content-Type"
> ...>
> tag and extract the charset from it (at least that is what I did in
> my kb_mailcs)

I see. I guess we don't have access to the HTTP-headers at this point?

But in my opinion if you change metaCharset to renderCharset the patch is ok.

Two observations:

You change the message-ids from md5(microtime()).'@domain.tld' to md5(microtime()).'@'.t3lib_div::getIndpEnv('TYPO3_HOST_ONLY') which is a very good thing.

And I note that we use still chr(10) for creation of mail headers and content. Did anybody read and try to understand my notes on the correct usage of line separators in mails?
The correct behaviour is: use the local line separator when talking to an MTA (eg LF on Unix / usually with PHP-mail on Unix) but CR/LF when talking to an SMTP server (usually PHP-mail on Windows).


More information about the TYPO3-team-core mailing list