Mail()是否可以在Localhost上运行?

时间:2017-12-01 16:56:00

标签: php mysql

每次在项目中使用mail()标记时,我都会收到此错误。

    Warning: mail(): "sendmail_from" not set in 
php.ini or custom "From:" header missing in C:\xampp\htdocs\alex\contact.php on line 75

这是我的代码:

$to = "ahmedmaheratya@gmail.com";

         $subject = "A New Message From" . $email;

         $body = "Here's the Message <br>" . $msg;

         mail($to, $subject, $body, "try@website.com");

        redirestMsg($theMsg, 'back', 900);

是因为我在本地主机上吗?还是有些错字?

0 个答案:

没有答案