note 37734 added to function.mail

From: Date: Tue, 25 Nov 2003 00:17:13 +0000
Subject: note 37734 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-60932@lists.php.net to get a copy of this message
Seems kind of odd there is no mention of the requirements of the e-mail address in the To: field. Here are some results of incorrect uses of the mail() function. mail("bad_addr",$subj,$body); //a warning gets thrown : Warning: Bad Message destination . mail("@bad_addr",$subj,$body); //a warning gets thrown : Warning: Server Error mail("bad_addr@",$subj,$body); //no warning mail("bad_addr@bad",$subj,$body); //no warning To prevent warnings from appearing (without playing with error_reporting) try to validate your form data with one of the zillion "solutions" that appears under the user notes for the ereg functions such as http://us2.php.net/manual/en/function.ereg.php#34133 (these observations from PHP 4.0.5, IIS 5.0) ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37734 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37734&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37734&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60932) next »