[TYPO3-core] RFC: HTMLmail charset

Bernhard Kraft kraftb at kraftb.at
Mon Oct 24 03:35:32 CEST 2005

Martin Kutschker wrote:

>>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 choose ->metaCharset because of the following reason:
renderCharset is just the charset in which T3 generates the HTML pages. But metaCharset is the one as
which the browser handles the page as it is sent in the META tag and also in the sent HTTP headers.

So if you have a form and input values the browser will use the metaCharset and if you then send the mail
it should get sent with this charset which the user/browser has used.

See my concern ?

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

No. Sadly not in all cases. CURL would enable us to get the headers but I don't know of a way to get
the HTTP headers from an fopen HTTP reply.

> 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.

Hmm. I think it is ok to include this in this patch. I suppose @domain.tld was used in a time when getIndpEnv didn't exist.

> 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).

You are right ! But this should be a second patch and isn't related to this one.
I know the problem that newlines get stripped away from plaintext emails but this also happend with the current settings
and on a UNIX webserver with local smtp server. Would be very interested if you could shed some light on me how newlines
INSIDE the mail must get handled (personal mail - not on the list please).


More information about the TYPO3-team-core mailing list