Home >Backend Development >PHP Tutorial >PHP发送邮件相关解决方法

PHP发送邮件相关解决方法

WBOY
WBOYOriginal
2016-06-13 10:28:11897browse

PHP发送邮件相关
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>

我是初学php者,我用上述代码发送一个邮件,但是我的邮箱里面并没有收到邮件,想知道这是为什么?我的配置是apache+php
是不是还需要修改什么东西呀?请回复的稍微详尽一些,O(∩_∩)O谢谢

------解决方案--------------------
需要配置发件服务器

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn