RE: [PHP] Check "@" in Record & show Error in mail() !!

From: Date: Mon, 11 Mar 2002 19:50:15 +0000
Subject: RE: [PHP] Check "@" in Record & show Error in mail() !!
Groups: php.general 
Request: Send a blank email to php-general+get-88073@lists.php.net to get a copy of this message
$result = mysql_query("SELECT * FROM sms where email LIKE \"%@%\" ORDER BY ID DESC",$db); -----Original Message----- From: Thomas Edison Jr. [mailto:thomasedisonjr@yahoo.com] Sent: Monday, March 11, 2002 12:18 PM To: RIVES Sergio Cc: php-general@lists.php.net Subject: [PHP] Check "@" in Record & show Error in mail() !! Hi, I'm using the following code to get Email Address stored in a table in my Database : <?php $db = mysql_connect("localhost","user","pass"); mysql_select_db("mydb",$db); $result = mysql_query("SELECT * FROM sms where email!='' ORDER BY ID DESC",$db); if ($myrow = mysql_fetch_array($result)) { do { echo("<b><font color=#6ed8ff>$myrow[email]</b> <br>"); } while ($myrow = mysql_fetch_array($result)); } else { echo "Sorry, no records matching your criteria were found!"; } ?> But there are some records where the user has entered something else.. not the Email Address. I would like to list only those records out of these, who do contain the letter "@", so that i'm sure only those records which actually do contain an Email Adress are listed. Also, when sending an email, like this : if($submit) { $headers .= "From: Mjimm.com <newsletter@mjimm.com>\n"; $headers .= "X-Sender: <newsletter@mjimm.com>\n"; $headers .= "X-Mailer: PHP\n"; // mailer $headers .= "Reply-To: <newsletter@mjimm.com>\n"; // Return path for errors $headers .= "bcc:$b\n"; // BCCs to mail($to,$subject,$message,$headers); } ?> If there are any errors in sending the mail, how can i get those errors, or at least have the alert that an error was there and mail could not be sent, printed on the page? Thanks, T. Edison jr. ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : abraxastech@yahoo.com Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#88073) next »