如何使用 php 设置“返回路径”?
我尝试过什么
$subject = "title \"" . $row['title'] . "\"";
$headers = "From: test <no_replay@test.com>\r\n";
$headers .= "Return-Path: no_replay@test.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
mail($email,$subject,$addletter,$headers);
Run Code Online (Sandbox Code Playgroud)
从gmail来源我看到Return-Path: <apache@localhost.localdomain>
对于 Windows返回路径:应该有效。在 Linux 上,您必须使用-f sendmail 选项。更多信息可以在这里找到http://php.net/manual/en/function.mail.php
mail($email,$subject,$addletter,$headers, "-fno_replay@test.com");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2028 次 |
| 最近记录: |