淮安市承德北路76号:请问php中的mail函数有用吗?为啥我测试总是不成功?
来源:百度文库 编辑:神马品牌网 时间:2024/05/11 18:11:10
我的测试代码如下~~要把test送往'peopleconnected@yahoo.com.cn'
<?php
$toaddress='peopleconnected@yahoo.com.cn';
$subject='Freeback from website';
$mailcontent='test';
$fromaddress='from: williamdeforest@hotmail.com';
mail($toaddress,$subject,$mailcontent,$fromaddress);
echo 'Sucess';
?>
<?php
$toaddress='peopleconnected@yahoo.com.cn';
$subject='Freeback from website';
$mailcontent='test';
$fromaddress='from: williamdeforest@hotmail.com';
mail($toaddress,$subject,$mailcontent,$fromaddress);
echo 'Sucess';
?>
mail()函数发送的邮件绝大多数会被当作垃圾邮件挡在外面。最好使用phpmailer,网上搜一下即可。效果示例:
http://greenblue.php5.cz/mail.html
需要安装配置邮件服务
具体方法网上有