note 21998 deleted from function.mail by dams

From: Date: Mon, 03 Jun 2002 12:39:38 +0000
Subject: note 21998 deleted from function.mail by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-31379@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"; } ?>

« previous php.notes (#31379) next »