我正在编写一个支持票证网站并需要电子邮件功能(PEAR),但我一直遇到这个问题:
下面的“No From: address has been provided”是脚本的一部分,显示了我认为问题出在哪里,请注意:敏感信息已被删除/编辑。
谢谢:
$replyto = "REDACTED";
$host = "REDACTED";
$username = "REDACTED";
$password = "REDACTED";
$mime = '1.0';
$content = 'text/html; charset=ISO-8859-1';
$subject = $subject;
$mime = "1.0";
$content = "text/html; charset=ISO-8859-1";
$headers = array ('From ' => $replyto,
'To ' => $to,
'Reply-To ' => $replyto,
'Mime-Version ' => $mime,
'Subject: ' => $subject,
'Content-Type' => $content);
$smtp = Mail::factory('smtp', array('host'=>$host,
'auth'=> true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to,$headers,$body);
if(PEAR::isError($mail)) {
echo "ERROR: Could not send email: " . $mail->getMessage();
} else {
$url = "http://support.myfallen.net/ticket.php?id=" . $internalId . "&successCode=1";
header('Location:' . $url);
}