问题
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