我在网站上有一个联系表单,如果您提交它将发送到网络邮箱。 示例:PHP无法发送邮件到网络邮箱
$isi_pesan = $message;
$additional_headers = "From: ".$email."" . "\r\n" . "Reply-To: $email";
$subject = 'Pesan untuk engineering.co.id';
$to = '[email protected]';
// $to = '[email protected]'; //this works
if(mail($to, $subject, $isi_pesan, $additional_headers))
echo '<div class="success-msg">Success !</div>';
else
echo '<div class="error-msg">Failed !</div>';
我得到的消息是“成功!”但是我在收件箱webmail中没有任何东西。如果$ to不是网络邮件,PHP邮件就可以工作。所以我必须改变什么设置才能让邮件在webmail中工作?提前致谢。
'mail()'函数通常在Linux服务器上使用sendmail。请检查你的服务器是否有邮件设置[配置](http://php.net/manual/en/mail.configuration.php)。如果没有,您可以使用[PHPMailer](http://phpmailer.worxware.com/)与任何SMTP或POP3。 – user1190992 2013-05-06 18:03:34