发送的消息中的下一行无效

时间:2016-05-15 07:46:25

标签: php

    $e_body = "You have been contacted by $Name from the xxxxx contact forms. Their message is as follows:"."\r\n";
    $e_content = "\"$Message\""."\r\n";
    $e_reply = "You can contact $Name via email, $Email";
    $msg = wordwrap( $e_body . $e_content . $e_reply, 70 );

    php mailer code
    $mail->Subject = "$appName Contact Forms";
    $mail->Body    = $msg;

似乎“\ r \ n”无效。它没有移动到下一行。我究竟做错了什么。任何帮助??? 谢谢!

我尝试用html
代替\ r \ n。因此代码读取

$e_body = "You have been contacted by $Name from xxxx contact forms. Their message is as follows:"; echo "<br/><br/>";
$e_content = "\"$Message\""; echo "<br/><br/>";
$e_reply = "You can contact $Name via email, $Email";

$msg = wordwrap( $e_body . $e_content . $e_reply, 70 );

但这也不起作用。请问这里有什么问题。有什么帮助吗?

1 个答案:

答案 0 :(得分:1)

实际上换行符出现在输出中,但浏览器不会渲染它们。

如果您想在网页上看到换行符,请使用html Bike.Vehicle标记。