Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a line break in a plain text email RoR?

I'm sending a plain text email and was wondering how I add a line break to this. It's showing up on on the same line.

From: <%= @name %>
<%= @text %>

Thanks

like image 757
adamwstl Avatar asked Jun 09 '10 19:06

adamwstl


3 Answers

<%= "\r\n" %>

In double quotes and inside '<% %>'.

Otherwise it's considered as simple text.

like image 87
Sergii Mostovyi Avatar answered Oct 17 '22 00:10

Sergii Mostovyi


\r\n

or if you're sending html email:

<br />

so:

From: <%= @name %> \r\n <%= @text %>
From: <%= @name %> <br /> <%= @text %>
like image 12
Jimmy Avatar answered Oct 16 '22 22:10

Jimmy


I could be completely wrong, but isn't it a simple \n ?

like image 2
Christina Mayers Avatar answered Oct 16 '22 22:10

Christina Mayers