[英]SMTP server response: 530 5.7.57
I am trying to send a mail with php. 我正在尝试用php发送邮件。 I watched in the internet to find a solution and I found diferent ways but not one helped me. 我在互联网上观看,找到了解决方案,但发现了不同的方法,但没有人帮助过我。 When I come to the code where it should send the mail I got following error: 当我到达应该发送邮件的代码时,出现以下错误:
mail(): SMTP server response: 530 5.7.57 SMTP; mail():SMTP服务器响应:530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [AM4PR08CA0065.eurprd08.prod.outlook.com]" 客户端未通过身份验证可在[MA4PR08CA0065.eurprd08.prod.outlook.com]的邮件中发送匿名邮件”
mail call: 邮寄电话:
$mailAdr = "name@company.ch";
$subject = "subject";
$msg = "message!";
$header = 'FROM: My WebSite <name@company.ch>';
mail($mailAdr, $subject, $msg, $header);
I set the right smtp and port. 我设置了正确的smtp和端口。 Can anyone tell me what I am doing wrong? 谁能告诉我我在做什么错?
I think you have to add your FROM header that is missing in your code. 我认为您必须添加代码中缺少的FROM标头。
<?php
$header = 'From: My Website <info@example.com>' . "\r\n";
mail($empfaenger, $betreff, $nachricht, $header);
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.