Adding line breaks to a text/plain email

Chuck Le Butt picture Chuck Le Butt · Mar 8, 2012 · Viewed 71.4k times · Source

I'm having a problem sending a plain text (not HTML!) email, all my line breaks are being ignored:

->setBody('Did you request a password reset for your account?\r\n\r\nIf yes, click here:\r\nhttp://www.website.com', 'text/plain');

The above is being displayed in the email as:

Did you request a password reset for your account?\r\n\r\nIf yes, click here:\nhttp://www.website.com

I've checked and the header is apparently set correctly:

Content-Type: text/plain; charset=utf-8

Does anyone have any experience with this?

Answer

silly picture silly · Mar 8, 2012

use double quotes like this

->setBody("Did you request a password reset for your account?\r\n\r\nIf yes, click here:\r\nhttp://www.website.com", 'text/plain');