这段代码有什么问题(电子邮件发送) [英] What is wrong with this code(EMail sending)

查看:113
本文介绍了这段代码有什么问题(电子邮件发送)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装并配置了hmailer。



但每次我尝试发送邮件时都会收到此错误:



(!)警告:mail():SMTP服务器响应:550地址无效。在第8行的C:\ wamp \\\\TestMail.php



I have hmailer installed and configured.

But each time I attempt to send a mail I get this error:

( ! ) Warning: mail(): SMTP server response: 550 The address is not valid. in C:\wamp\www\TestMail.php on line 8

<?php
$from = "myusername@yahoo.com";
$to = "myusername@gmail.com";

$message = "This is a test";
$subject = "Test";

if(mail($to,$subject,$message))//This is line 8.
{

	printf("Mail sent.");
}
else
{
	print("Mail not sent");
}
?>





什么可能是错的?



What could be wrong?

推荐答案

from = myusername@yahoo.com;
from = "myusername@yahoo.com";


to = myusername@gmail.com;

to = "myusername@gmail.com";


消息 = 这是一个测试;
message = "This is a test";


这篇关于这段代码有什么问题(电子邮件发送)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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