为什么我在php中使用mail()获取此警告 [英] Why I am getting this warning using mail() in php

查看:77
本文介绍了为什么我在php中使用mail()获取此警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我们知道PHP允许我们直接从脚本发送电子邮件。所以我创建了一个php文件。这个文件的编码在这里: -



Hi. As we know that PHP allows us to send e-mails directly from a script.so i have created a php file. Coding of this file is here:-

<?php
$to = "anoop27@rocketmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "27anoopsharma@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>





我收到警告

警告:mail()[function.mail]:SMTP服务器响应:550 5.7.1无法中继ano​​op27@rocketmail.com in第7行的C:\Program Files \xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\



最后我有一条消息说我发送邮件后打印的是'邮件发送'。但是我没有收到任何邮件我的电子邮件帐户



请帮助我。

Thanx in adance



while running this file using xampp i am getting a warning
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for anoop27@rocketmail.com in C:\Program Files\xampp\htdocs\form\mailphp.php on line 7
Mail Sent.

In last I have a message that i have print after sending mail is 'Mail Sent'.But i have not received any mailon my email account

Please Help me.
Thanx in adance

推荐答案

to = < span class =code-string> anoop27@rocketmail.com;
to = "anoop27@rocketmail.com";


subject = 测试邮件;
subject = "Test mail";


消息 = Hello!这是一封简单的电子邮件。;
message = "Hello! This is a simple email message.";


这篇关于为什么我在php中使用mail()获取此警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆