PHP로 이메일을 보내는 데 문제가 있습니다. 내 코드에 문제가있는 것을 볼 수 있습니까?PHP의 메일 기능 문제
php.ini의 메일 설정 :
[mail function]
SMTP = mail.ntserv.co.in
smtp_port = 26
코드 :
<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "hi, How r u";
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
출력 : 당신이를 통과해야 같은
이Warning: mail() [function.mail]: SMTP server response: 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail. in C:\xampp\htdocs\vijay\demo\msg.php on line 7 Mail Sent.
조금 더 자세하게 설명하면 도움이 될 것입니다. 예를 들어, 오류 메시지가 나타나거나 이메일을받지 못했습니까? – cori
음, Gmail 서버를 사용하여 자신의 스크립트에서 이메일을 보내려는 것처럼 보입니다. 그럴 수는 없지만 확실하게 ... – Mathew
Mr, cori, 이제 코드를 편집했습니다. 오류 : 같이 표시 경고 : mail() [function.mail] : SMTP 서버 응답 : 551이 메일 서버는 로컬로 호스트 된 도메인에서 메일을 보내기 전에 인증을 요구합니다. 메일을 보내기 전에 인증 할 메일 클라이언트를 다시 구성하십시오. C : \ xampp \ htdocs \ vijay \ demo \ msg.php (7 행) 메일이 전송되었습니다. – kumar