【问题标题】:How to include a html page from server which will be displayed at the php email body?如何包含来自服务器的 html 页面,该页面将显示在 php 电子邮件正文中?
【发布时间】:2015-07-27 10:01:25
【问题描述】:

我想发送一封电子邮件,而不是“一些文本”,我希望它从服务器回显 page.html,并且该页面是所有电子邮件。

$mail->Body    = 'some text';

谢谢!

【问题讨论】:

  • $mail->Body = file_get_contents('page.html')。我很确定这不是您想要的,但这是您问题的确切答案:o)请扩展并解释您要做什么。

标签: php html email


【解决方案1】:

使用file_get_contents来实现这个

<?php 

// this will get content of file as a string 
$htmlContent = file_get_contents("path/to/page.html");

$mail->Body = $htmlContent;
?>

参考 - File get Content

【讨论】:

    猜你喜欢
    • 2012-03-11
    • 1970-01-01
    • 1970-01-01
    • 2014-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多