안녕하세요 먼저 메일 기능을 테스트하여 오류를 표시하고이를 사용하여 테스트합니다. mail() 함수가 의도적으로 작동하는 전자 메일이 도착하지 않음
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$email = "[email protected]";
$subject = "Test Message";
$msg = "This is a test message";
$eLog="/tmp/mailError.log";
//Get the size of the error log
//ensure it exists, create it if it doesn't
$fh= fopen($eLog, "a+");
fclose($fh);
$originalsize = filesize($eLog);
mail($email,$subject,$msg);
/*
* NOTE: PHP caches file status so we need to clear
* that cache so we can get the current file size
*/
clearstatcache();
$finalsize = filesize($eLog);
//Check if the error log was just updated
if ($originalsize != $finalsize) {
print "Problem sending mail. (size was $originalsize, now $finalsize) See $eLog
";
} else {
print "Mail sent to $email";
}
?>
이
이 계정을 [email protected]에 도착되지문제는이 코드를 전송해야 메일입니다 ..이 작동하고 이메일을 보내는 것을 나에게 말하고있다 (느릅 나무 나는 진짜 이메일을 위해 바꾼다)
왜? 또한 php.ini 파일도 괜찮은 것 같지만 올바른 매개 변수를 찾지는 못했을 것입니다. 내가 그 downvote에 대해주의를 해달라고
1)() 2) 이메일로하면 PHP는 손을 어떻게되는지 서버의 메일 로그를 확인 메일의 리턴 값을 확인합니다. 3) 수신 계정의 스팸 폴더를 확인하십시오. –
또한 문제 해결을 수행하십시오. mail() 행을 주석으로 처리하고 기본 행을 추가하여 작동하는지 확인하십시오. mail ('[email protected] ','test ','some content '); 그렇다면 코드에 있는지 아닌지 적어도 알 수 있습니다. – Steve
확인 1) 방법을 알려주세요. . 2) 나는 /tmp/mailError.log에 오류가 없다고 확인한다. 3) 나는 거기에 이메일을 보내지 않았다 : ( –