[TYPO3-core] RFC: HTMLmail charset

Martin Kutschker Martin.Kutschker at blackbox.net
Mon Oct 24 09:54:15 CEST 2005

Bernhard Kraft <kraftb at kraftb.at> writes on 
Mon, 24 Oct 2005 03:35:32 +0200 (METDST):

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

I see. This makes sense.

But be aware that all internal functions of TYPO3 work with renderCharset. The whole generated contents is converted right before sending to the client.

I'm not sure if this is really a problem with mails. But it could lead to surprises, if you generate mail content in renderCharset (implicitly with TYPO3 functions) but tag the mail with metaCharset.

Kasper, did I get this right?

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

Hey, I said "very good thing". This means agree and I'm happy you did it. :-)

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

You cannot preserve the original line separator for plain text. The mail protocol simply strips this information. Every mail within the mail system uses CRLF on protocol level.

If you need the original file you must send it as application/octect-stream (base64!).


More information about the TYPO3-team-core mailing list