FOudn and Fixed email format bug

inc/utils.inc.php

I have been going crazy with thunderbird showing server generated text emails wrong. (for example spam reports), it shows in the main pane

MIME-Version: 1.0

From: SITE  NAME <noreply@mysite.tld>



User XXXX (11) reported that user YYYYY (7) spammed.



Reporter: http://www.mysite.tld/profile.php?ID=11

Spammer: http://www.mysite.tld/profile.php?ID=7


and no field shows for the sender in my mail index, it went off to the body.

So I have been googling all day and found lots of people with this - for a year, but no working fix. People were runnign off on wild goose chases checkign if the DBs were set to UTF etc.

Anyway eventually I found the problem. Strictly speaking, email headers should have NO DOUBLE LINE BREAKS, and some clients (thunderbird) do seem to take that seriously

in inc/utils.inc.php you will find

$sMailHeader = "MIME-Version: 1.0\r\n" . $sMailHeader;
if( 'html' == $sEmailFlag) {
$sMailHeader = "Content-type: text/html; charset=UTF-8\r\n" . $sMailHeader;
$iSendingResult = mail( $sRecipientEmail, $sMailSubject, $sMailBody, $sMailHeader, $sMailParameters );
} else {
$sMailHeader = "Content-type: text/plain; charset=UTF-8\r\n" . $sMailHeader;
$iSendingResult = mail( $sRecipientEmail, $sMailSubject, html2txt($sMailBody), $sMailHeader, $sMailParameters );


Where "\r\n" creates TWO LINE BREAKS for me. I changed it from "\r\n" to "\n" and my email display and format problems went away :-)

Dolphin Free  6.1-4 running on RHEL5.

Quote · 21 Jan 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.