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

半城伤御伤魂 提交于 2019-12-05 19:39:06

问题


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


回答1:


\r\n

or if you're sending html email:

<br />

so:

From: <%= @name %> \r\n <%= @text %>
From: <%= @name %> <br /> <%= @text %>



回答2:


<%= "\r\n" %>

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

Otherwise it's considered as simple text.




回答3:


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



来源:https://stackoverflow.com/questions/3009414/how-to-get-a-line-break-in-a-plain-text-email-ror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!