这是PHP网站上的示例代码:
<?php
$to = '[email protected]'; //这里已经改为自己的email
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
我的环境是,
1. Mac Pro上mountain lion运行的MAMP
2. Windows 7上运行的XAMPP
都修改了php.ini 里面的 [mail function]的设置.
不管是MAMP 还是XAMPP , 都是发送成功。就是收不到邮件。
大家觉得是什么原因啊?
<?php
$to = '[email protected]'; //这里已经改为自己的email
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
我的环境是,
1. Mac Pro上mountain lion运行的MAMP
2. Windows 7上运行的XAMPP
都修改了php.ini 里面的 [mail function]的设置.
不管是MAMP 还是XAMPP , 都是发送成功。就是收不到邮件。
大家觉得是什么原因啊?