Avatar of flynny
Flag for United Kingdom of Great Britain and Northern Ireland asked on

\r\n appearing in registration email from Joomla

Hi all,

Basically when I register from my Joomla site the registration activation email being sent contains the \r\n instead of the newline?

The settings we are using are as follows;

    Mailer * SMTP
    From email admin@domain.co.uk
    From Name admin
    Sendmail Path /usr/sbin/sendmail
    SMTP Authentication Yes
    SMTP Security None
    SMTP Port * 587 (also tried 25)
    SMTP Username admin@domain.co.uk
    SMTP Password correct pass
    SMTP Host auth.smtp.1and1.co.uk

is there anything I can do to stop this?
JoomlaContent ManagementWeb Languages and StandardsWeb Development

Avatar of undefined
Last Comment

8/22/2022 - Mon

Carriage return then line feed, CRLF, what you are seeing above, is apparently the expected end-of-line marker for most internet protocols,  so Joomla is behaving correctly.

Why is \r\n a problem for you?

sorry i understand what these symbols are. It is just when an email is received they are appearing a \r\n instead of the CRLF.

In that case it is down to your Email client not interpreting the characters correctly.  What client are you using?
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

outlook all other html emails etc are coming through ok?

I would have thought it would interpret this??

Hmm.  Does this link help at all?


Thanks for the link.

I've tried pulling the fix out and adding it to the /languages/phpmailer/stmp.php i.e.

	$CRLF = wordwrap($CRLF, 70); // Just to be safe that SMTP-send works
	$CRLF = str_replace('\r\n', "\r\n", $CRLF); // Replace Windows breaks (rn)

Open in new window

to the __construct() method but this has changed anything.

As the link is for the cb_builder plugin I am not sure what else to change? (I assume this is the right file :) )
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

I am at a loss now, I am afraid.  I suggest you request additional attention using the "Request Attention" link above.

Sorry I can't help any more.


Just a thought, but did you change the email to send as HTML? If so, replace the /r/n with <br/>
Ray Paseur

Maybe the \r\n are enclosed in single quotes?  If so, try changing them so they are enclosed in double quotes like " instead of '
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy

I'm puzzled.  Exactly what is the problem?
In the question you state you have \r\n rather than a newline.  Later you say you don't see the CRLF.

I'm probably repeating bits of earlier comments here:

\n is a newline (also called line feed)
\r\n is a carriage return and new line pair of characters
CRLF is a shorthand for Carriage Return Line Feed which is \r\n
In code one might have a mcaro called CRLF which expands to \r\n - on viewing a string the \r\n does NOT get printed out as CRLF

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question