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

时间:2016-12-25 14:13:25

标签: php email

使用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 ');
              }

我是否需要添加另一个标题? 感谢

1 个答案:

答案 0 :(得分:2)

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

像这样修改标题

相关问题