note 70923 added to function.mail
| From: | JeffreyJarnotatCOMCASTdotnet at osu1 dot php dot net | Date: | Sat, 04 Nov 2006 05:11:49 +0000 |
| Subject: | note 70923 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119364@lists.php.net to get a copy of this message | ||
I did not see to many items for error checking the mailoutput. This seems to work just fine for me.
I tested via a change in the SMTP addt to a bogus one.
IT used the TRY CATCH
JJ
$to = 'somebody@php.net';
$subject = 'User Support Request ' ;
$message = $sometextbox;
$went = 'The email was sent ';
$notwent = 'The email DID NOT SEND. Please call your helpdesk for assistance';
try {
mail($to, $subject, $message);
}
catch (Exception $e)
{
echo 'Sorry email sent failed. Pleae call the help desk';
echo 'Exception ' . $e->getcode() . ': ' . $e->getMessage() . '<br
/>';
}
if (isset($e)) {
echo $notwent ;}
else{ echo '<strong><font color="#CC0000">' . $went . 'at
' . date("n/j/Y - g:i:s") .'</font></strong>'; }
}
----
Server IP: 216.194.113.175
Probable Submitter: 68.41.149.132
----
Manual Page -- http://www.php.net/manual/en/function.mail.php
Edit -- https://master.php.net/note/edit/70923
Del: integrated -- https://master.php.net/note/delete/70923/integrated
Del: useless -- https://master.php.net/note/delete/70923/useless
Del: bad code -- https://master.php.net/note/delete/70923/bad+code
Del: spam -- https://master.php.net/note/delete/70923/spam
Del: non-english -- https://master.php.net/note/delete/70923/non-english
Del: in docs -- https://master.php.net/note/delete/70923/in+docs
Del: other reasons-- https://master.php.net/note/delete/70923
Reject -- https://master.php.net/note/reject/70923
Search -- https://master.php.net/manage/user-notes.php