Previous Thread
Next Thread
Print Thread
Hop To
#241393 01/27/2011 6:06 PM
Joined: Feb 2007
Posts: 57
journeyman
journeyman
Joined: Feb 2007
Posts: 57
I'm not sure if this is my system, or a bug, but always in the past on my Windows 2000 server, I would need to modify \libs\phpmailer\class.phpmailer.php after upgrading as follows for emails to be sent correctly, as per the SMTP RFC:

var $LE = "\r\n";

However, when I moved back to Linux, emails did not work correctly until I changed the line back to the default of:

var $LE = "\n";

Since the RFC for SMTP requires CRLF line breaks (aka \r\n), I assume that Linux adds in the CRs necessary when actually sending, which is why the \r\n doesn't work on Linux -- it actually is sending \r\r\n !

In any case, I would suggest that the code autodetect the platform, and send the CRLF on Windows servers, and only the LF on Linux servers -- unless it's just my server or something.

P.S. Also I was having some problems with emails in the past that was fixed by modifying this line of code to add some extra blank lines at the end of the email, so the end-of-email terminator would be detected correctly:

//$body = $this->CreateBody();
$body = $this->CreateBody() . $this->LE . $this->LE . $this->LE;

Thanks,
Shane


RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH
kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
phpmailer class is used all over the place. i'm surprised that is a problem

i run on both doze and nix machines with off the shelf phpmailer, sending both text and html emails with no problems.

smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 764 guests, and 261 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)