我可以使用PHP邮件()从Web表单发送电子邮件。但是,当我尝试使用表单使用Mailman来订阅电子邮件地址时,邮递员不回应。
例如:
$listServe = "myaddress@gmail.com";
$name = check_input($_POST['inputName'], "Your Name");
$email = check_input($_POST['inputEmail'], "Your E-mail Address");
$subject = "";//check_input($_POST['inputSubject'], "Message Subject");
$message = "";//check_input($_POST['inputMessage'], "Your Message");
//$from_add = $email; //"email From - required"
$headers = "From: $email \r\n";
$headers .= "Reply-To: $email \r\n";
$headers .= "Return-Path: $email\r\n";
$headers .= "X-Mailer: PHP \r\n";
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Invalid e-mail address");
}
$message = "
This is a test from the web form:
Name: $name
Email: $email
Subject: $subject
Message: $message
";
/* Send the message using mail() function */
mail($listServe, $subject, $message, $headers, '-f' .$email);
exit();
//function check_input(...
//function show_error(...
?>一条消息发送到我的Gmail帐户。
但是,如果我更改$listServe = "mylist-subscribe@lists.mydomain.com",我无法订阅该列表...邮递员没有指示有人试图订阅。
当我看着maillog时,似乎所有内容都被正确发送
Jul 20 10:08:48 web postfix/pickup[7461]: 260654232218: uid=48 from=
Jul 20 10:08:48 web postfix/cleanup[9175]: 260654232218: message-id=<20170720150848.260654232218@lists.mydomain.com>
Jul 20 10:08:48 web postfix/qmgr[2435]: 260654232218: from=, size=628, nrcpt=1 (queue active)
Jul 20 10:08:48 web postfix/smtp[9177]: 260654232218: to=, relay=sendmailrh01.mydomain.com[10.13.18.105]:25,delay=0.18, delays=0.04/0.04/0.01/0.09, dsn=2.0.0, status=sent (250 2.0.0 v6KF8mXJ031966 Message accepted for delivery)
Jul 20 10:08:48 web postfix/qmgr[2435]: 260654232218: removed订阅邮递员列表通常是一个相当简单的过程。如果我从任何普通电子邮件帐户邮寄到mylist-subscribe@lists.mydomain.com,它将反馈确认订阅响应。但是我无法从我的应用程序表单中找到它。