繁体   English   中英

HTML电子邮件已压缩

[英]HTML email message condensed

下面的查询会发送一封电子邮件。 可以,但是该消息基本上压缩为一个较长的段落。 我想在下面有</br>标签的地方休息一下。 但是, </br>标记被忽略。 知道我怎么可以在那里休息吗?

提前致谢,

约翰

        $message1 = "
    Someone made the following comment on your submission $submission:

    </br>

    $comment

    Please click the link below to see the comment in context.

    </br>

    $link1

    ";

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

    $queryem = mail($mailaddress, "Someone has commented on your submission 
                            $submission.", $message1, $headers);

br标签引入换行符 ,而不是新段落。

如果需要段落,请使用p

$message1 = "
<p>Someone made the following comment on your submission $submission:</p>
<p>$comment</p>
<p>Please click the link below to see the comment in context.</p>";

我认为您已经对$comment进行了消毒。 如果没有,则用户几乎可以完全控制电子邮件的外观。

不要手动构建MIME电子邮件。 如您所见,这是有问题的,而且很容易破解。 使用类似PHPMailerSwiftmailer的工具为您完成任务。 您所要做的就是提供内容和地址,它们将为您处理标题/设置。

br标签是<br/>而不是</br> 第一个是空标记,表示换行符。 第二个含义是用于打开<br>的结束标记,这是不必要的。

</br> ,请使用<br /><br>代替</br> (插入HTML新行),因为它不是HTML有效标记。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM