I am sending mails from php mail() : and I want to receive a failed message if sending is failed to the destinatio .
$to = 'itsdfdsf@7sisters.in';
$email_from = "info@7sisters.in";
$full_name = 'XXXX';
$from_mail = $full_name.'<'.$email_from.'>';
$subject = "testing sender name";
$message = "";
$message .= '
<p><strong>This is only a test mail. Please do not reply.</strong><br />
';
$from = $from_mail;
//$headers = "" .
// "Reply-To:" . $from . "
" .
// "X-Mailer: PHP/" . phpversion();
$headers = "From:" . $from_mail . "
" .
"Reply-To:" . $from_mail . "
" .
"X-Mailer: PHP/" . phpversion();
$headers .= 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
if(!mail($to,$subject,$message,$headers))
{
echo 'failed !!';
}
But although $to
mail does no exist,it is not showing failed !!