【问题标题】:Newlines in Outlook 365 e-mail sent from Play Java从 Play Java 发送的 Outlook 365 电子邮件中的换行符
【发布时间】:2017-04-18 21:53:33
【问题描述】:

当我尝试使用 Play 框架的电子邮件实用程序将以下注释作为“text/html”发送时,新行没有被保留

     **Original string**
     this is a test
     this is a test

但我在电子邮件中看到的是换行符在 Outlook 或 Java 中的某处被放弃

     **Result**
     this is a test this is a test 

我已经尝试了下面的所有建议,将 br、\n、\r\n、\t\t 等添加到我的程序中,但仍然无法正确显示新行

How do I format a String in an email so Outlook will print the line breaks?

【问题讨论】:

    标签: java html email playframework outlook


    【解决方案1】:

    如果您的数据是 HTML,则换行符是 <br> HTML 元素。

    【讨论】:

    • 我试过
      但它不起作用。电子邮件打印消息中的
    • 那么你不是以 text/html 格式发送的。整个东西是带有 html 和 body 标签的格式良好的 HTML 吗?
    • 这是一个非常好的建议。经过仔细检查,我要出去,因为这是一个测试<br&gt这是一个测试<br&gt
    • 感谢您提醒有关格式良好的 HTML。那是我的问题。
    猜你喜欢
    • 2018-06-25
    • 2017-08-17
    • 2016-08-27
    • 2018-07-24
    • 2020-10-02
    • 2010-09-24
    • 2017-01-06
    • 1970-01-01
    相关资源
    最近更新 更多