php - 在 Headers From 字段中使用 Php 变量
问题描述
我正在尝试设置一个 PHP 邮件程序。由于某些未知原因,我不能在 From 字段上使用变量
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: Blaine<{$from_email}>\r\n";
$headers .= "Reply-To: " . $from_email . "" . "\r\n";
$headers .= "Content-Type: multipart/mixed;
boundary = $boundary\r\n\r\n";
而不是布莱恩,我想使用我之前设置的变量,但是当我这样做时,我试图设置一个 PHP 邮件程序。由于某些未知原因,我不能在 From 字段上使用变量
$headers .= "From: .$var <{$from_email}>\r\n";
我不知道发件人姓名
解决方案
$headers .= "From: $senderName <$senderEmail>\r\n";
推荐阅读
- apache - htaccess 显示 404 错误而不是找到 index.php
- r - 在excel中已有的数据中添加工作表
- javascript - 从另一个动态元素的高度调整元素的高度
- python-3.x - ImportError:无法从“urllib3.util.ssl_”导入名称“OP_NO_TICKET”
- swiftui - 在初始化 SwiftUI 中将绑定传递给子视图
- mysql - 使用 regexp 和 sql 查找与特定特征匹配的单词
- java - 我想在 Java 中创建一个自定义 DateTimeFormatter
- google-sheets - 如何在使用 Countifs() 时摆脱这种情况下的数组大小错误
- animation - SwiftUI 动画 - 切换的布尔值始终以 true 结束
- sql-server - 为什么我的数据阅读器只返回一行?