diff --git a/t3lib/class.t3lib_formmail.php b/t3lib/class.t3lib_formmail.php index d87f0af..89cbb71 100644 --- a/t3lib/class.t3lib_formmail.php +++ b/t3lib/class.t3lib_formmail.php @@ -91,12 +91,15 @@ class t3lib_formmail { $this->mailMessage = t3lib_div::makeInstance('t3lib_mail_Message'); if ($GLOBALS['TSFE']->config['config']['formMailCharset']) { - // Respect formMailCharset if it was set + // Respect formMailCharset if it was set $this->characterSet = $GLOBALS['TSFE']->csConvObj->parse_charset($GLOBALS['TSFE']->config['config']['formMailCharset']); } elseif ($GLOBALS['TSFE']->metaCharset != $GLOBALS['TSFE']->renderCharset) { - // Use metaCharset for mail if different from renderCharset + // Use metaCharset for mail if different from renderCharset $this->characterSet = $GLOBALS['TSFE']->metaCharset; - } + } else { + // default charset is render charset + $this->characterSet = $GLOBALS['TSFE']->renderCharset; + } if ($base64 || $valueList['use_base64']) { $this->encoding = 'base64'; @@ -176,11 +179,12 @@ class t3lib_formmail { $this->plainContent = $plainTextContent; + // add charset to body settings to work around problems in swift mailer addPart(...) if ($valueList['html_enabled']) { - $this->mailMessage->setBody($htmlContent, 'text/html'); - $this->mailMessage->addPart($plainTextContent, 'text/plain'); + $this->mailMessage->setBody($htmlContent, 'text/html', $this->characterSet); + $this->mailMessage->addPart($plainTextContent, 'text/plain', $this->characterSet); } else { - $this->mailMessage->setBody($plainTextContent, 'text/plain'); + $this->mailMessage->setBody($plainTextContent, 'text/plain', $this->characterSet); } for ($a = 0; $a < 10; $a++) { @@ -328,4 +332,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_formmail.php']); } -?> \ No newline at end of file +?> diff --git a/typo3/contrib/swiftmailer/classes/Swift/Message.php b/typo3/contrib/swiftmailer/classes/Swift/Message.php index b5e63fc..b4c6662 100644 --- a/typo3/contrib/swiftmailer/classes/Swift/Message.php +++ b/typo3/contrib/swiftmailer/classes/Swift/Message.php @@ -74,6 +74,11 @@ class Swift_Message extends Swift_Mime_SimpleMessage */ public function addPart($body, $contentType = null, $charset = null) { + // inherit charset to new part + if($charset == null) { + $charset = $this->getCharset(); + } + return $this->attach(Swift_MimePart::newInstance( $body, $contentType, $charset ));