note 21998 added to function.mail

From: Date: Mon, 03 Jun 2002 12:14:27 +0000
Subject: note 21998 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-31378@lists.php.net to get a copy of this message
i'd like to get an error-email back to my replay-adress, if my mail-funktion sends an email to a unknown email-adress... does anybody has an idea? this shows me, if mail() was not send: <? $email = "you@yourhost.com"; $subject = "testmail"; $message = "this is a testmail"; $headers .= "From: ME <me@myhost.com>\r\n"; $headers .= "X-Sender: <me@myhost.com>\n"; $headers .= "X-Mailer: PHP\n"; //mailer $headers .= "X-Priority: 3\n"; $headers .= "Return-Path: <me@myhost.com>\n"; $mail_val = ""; $mail_val = mail($email, $subject, $message,$headers); echo "Mail Value = $mail_val"; if ($mail_val != 1) { echo "....bad e-mail address $email"; } else { echo "....good e-mail address: $email"; } ?> -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+21998 http://master.php.net/manage/user-notes.php?action=delete+21998 http://master.php.net/manage/user-notes.php?action=reject+21998

« previous php.notes (#31378) next »