메일을 보내려는 경우 아래 코드를 입력하십시오. 나는 일어날 것을 알고있다. localhost에서는 작동하지만 라이브 서버에서는 작동하지 않습니다.PHP 메일 기능이 온라인 서버에서 작동하지 않습니다.
if (isset($_POST['test_mail'])){
$to = '[email protected]'; //put email address on which mail send
$subject = "Newsletter"; //Put subject of mail here
$from = '[email protected]'; //put email address from
//email body start
// $body .= file_get_contents('file/'.$filename.'');
$body .= 'anio';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
// More headers
$headers .= 'From: '.$from. "\r\n";
//if you need to send cc mail then uncomment below line and change email address
//$headers .= 'Cc: [email protected]' . "\r\n";
mail($to,$subject,$body,$headers);
}
귀하의 메일 서버를 구성하거나 php.ini 파일에서 잘못되지 않습니다. 로그를 확인하십시오. –