Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHPMailer服务器->客户端:550 5.7.1无法中继_Php_Exchange Server_Phpmailer - Fatal编程技术网

PHPMailer服务器->客户端:550 5.7.1无法中继

PHPMailer服务器->客户端:550 5.7.1无法中继,php,exchange-server,phpmailer,Php,Exchange Server,Phpmailer,我无法使用phpmailer和microsoft exchange发送邮件 这是我的密码: $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = 'mail.myhost.com'; $mail->SMTPDebug = 2; $mail->Username = "myUsername"; $mail->Password = "myPassword"; $mail->From = "from@

我无法使用phpmailer和microsoft exchange发送邮件

这是我的密码:

$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = 'mail.myhost.com';
$mail->SMTPDebug  = 2;
$mail->Username   = "myUsername";
$mail->Password   = "myPassword";
$mail->From = "from@server.com";
$mail->AddAddress("some.address@gmail.com");
$mail->Subject = "Test";
$mail->Body = 'Test';
$mail->send();
我得到这个信息:

2014-06-04 13:34:49 SERVER -> CLIENT: 220 SRV-******.***.local Microsoft ESMTP MAIL Service ready at Wed, 4 Jun 2014 15:38:20 +0200 
2014-06-04 13:34:49 CLIENT -> SERVER: EHLO myhost.com
2014-06-04 13:34:49 SERVER -> CLIENT: 250-SRV-******.***.local  Hello [87.254.99.10] 250-SIZE 99999744 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-X-ANONYMOUSTLS 250-AUTH 250-X-EXPS NTLM 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250-XEXCH50 250 XSHADOW 
2014-06-04 13:34:49 CLIENT -> SERVER: MAIL FROM: 
2014-06-04 13:34:49 SERVER -> CLIENT: 250 2.1.0 Sender OK 
2014-06-04 13:34:49 CLIENT -> SERVER: RCPT TO: 
2014-06-04 13:34:54 SERVER -> CLIENT: 550 5.7.1 Unable to relay 
2014-06-04 13:34:54 SMTP ERROR: RCPT TO command failed: 550 5.7.1 Unable to relay 
2014-06-04 13:34:54 CLIENT -> SERVER: QUIT 
2014-06-04 13:34:54 SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel SMTP Error: The following recipients failed: some.address@gmail.com 
我的发件人和收件人地址不见了


有人知道问题出在哪里吗?

首先,我建议你将其变为现实

对于from字段,将其插入括号之间,并更改setFrom中的参数


看看这个:不确定,如果是问题。Thx,我认为是问题,我明天再看
$mail = new PHPMailer(true);
$mail->setFrom = ("from@server.com");