gpt4 book ai didi

php - 如何为 PHP 电子邮件添加标题?

转载 作者:行者123 更新时间:2023-12-05 03:10:02 25 4
gpt4 key购买 nike

用php发送邮件时,如何更改发送的邮件的标题,如下图所示。

Google Email List

我想把“联系”这个词改成别的。
这是我当前的代码:

$msg = "Thank you, " ."$inputUsername". ", for joining "."<a href='http://www.gamingpopulace.com'>Gaming Populace!</a> "."We hope that you enjoy the site and become very active." ;
$topic = "Thanks for joining";
$headers = "From: contact@gamingpopulace.com";
$headers .= "\r\nReply-To: contact@gamingpopulace.com\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1";
$email = preg_replace("([\r\n])", "", $email);
if (mail($email,$topic,$msg, $headers)) {
header('Location: ../index ');
}else {
header('Location: ../index ');
}

我需要添加另一个标题吗?
谢谢

最佳答案

$headers  = "From: Gaming Populace < contact@gamingpopulace.com >\n";

像这样修改你的标题

关于php - 如何为 PHP 电子邮件添加标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41321837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com