【问题标题】:Send with phpmailer a script in php $mail->Body = $PHPorHTML;使用 phpmailer 在 php $mail->Body = $PHPorHTML; 中发送脚本
【发布时间】:2021-08-05 16:10:32
【问题描述】:

如何为电子邮件发送 .html 或 .php 脚本模板

$HTML= "message.html";
$PHP= "message.php";
$mail->Body = $PHP;

这是发送https://pm.decolombiajoyas.com/templatemejorado.php的示例

我认为生成一个基于发送的 html,但需要更多的想法。

感谢您的支持。

【问题讨论】:

  • 你好,有效果吗?
  • 是但不编译php代码。我想首先在 HTML 文件中编译 PHP 代码。你知道这样做的任何方法吗?类似 HTML 缓存的功能。
  • 不,我不知道有什么方法可以做到这一点,您可以在 Google 上搜索或在 Stack Overflow 中提出新问题。另请单击我的答案旁边的灰色复选标记。 :)
  • 我尝试这样做:$htmlContent = file_get_contents("pm.decolombiajoyas.com/templatemejorado.php"); 但不起作用。布局有效,但在电子邮件中出现错误。不太好。
  • 将屏幕截图添加到被窃听的内容中?

标签: php html css phpmailer


【解决方案1】:

简单:

$htmlContent = file_get_contents("email_template.html"); // Here add location of file.
mail($htmlContent, ); // Add rest of contents that you want to send.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-04-15
    • 2017-08-08
    • 2013-04-13
    • 2012-08-20
    相关资源
    最近更新 更多