无法使用php中的mail函数发送邮件
有人能帮我回答我的问题吗..我无法使用php中的mail()发送邮件..以下是我的代码:无法使用php中的mail函数发送邮件,php,Php,有人能帮我回答我的问题吗..我无法使用php中的mail()发送邮件..以下是我的代码: if (isset($_POST["from"])) { $from = $_POST["from"]; // sender $subject = $_POST["subject"]; $message = $_POST["message"]; $message = wordwrap($message, 70); mail("test@example.com",$su
if (isset($_POST["from"])) {
$from = $_POST["from"]; // sender
$subject = $_POST["subject"];
$message = $_POST["message"];
$message = wordwrap($message, 70);
mail("test@example.com",$subject,$message,"From: $from\n");
echo "Thank you for sending us feedback";
}
当我在localhost中运行此程序时,输出显示为“感谢您向我们发送反馈”,但没有收到任何邮件test@example.com.检查php.ini配置文件并添加邮件服务器配置:
SMTP = server ; mail server
smtp_port = 25 ; port
sendmail_from = your@email.com ;
或
使用PHPMailer通过gmail、yahoo或任何外部邮件服务器发送邮件 如果未设置SMTP,mail()函数将无法在本地主机中工作??你在本地主机上配置了smtp服务器吗?我是用php mailer实现的。谢谢