Hello all,

I have the bellow script which will be called from the following URL
"http://172.24.110.113/sendmail.php?[EMAIL PROTECTED]&body=this is a
test message". The "to" and "body" field in the URL are variable. The
problem I have, there is no error checking in this script, it replays always
with "Email has been sent..." even if the the user not exists. It would be
nice to have some error checking regarding the SMTP server response like 200
= message sent or 550 = unknown user,.... Is there a way to check this with
PHP? (Î'm sure there is...)
It would be nice if you cold provide some Code exsample because my
programming experiance is not very high.


----------------------------------------------------------------------------
------------------------------------------------------
<?php
echo "<html><body>";

$to = preg_replace("/^0041/", "0", $to);

$recipient = $to;
$subject = "OneBox, SMS to Email service";
$message .= " \n";
$message .= $body;
$message .= " \n";
$message .= " \n";
$message .= " \n";
$message .=
"------------------------------------------------------------------;
$message .= "body footer\n";
$message .=
"------------------------------------------------------------------;
$message .= " \n";
#$extra = "From: [EMAIL PROTECTED]";
#$extra = "From: SMS to E-Mail Service
<[EMAIL PROTECTED]>\r\nReturn-Pa;
$extra .= "From: SMS to E-Mail <[EMAIL PROTECTED]>\n";
$extra .= "X-Sender: <[EMAIL PROTECTED]>\n";
$extra .= "X-Mailer: PHP\n";
$extra .= "X-Priority: 3\n";
$extra .= "Return-Path: <[EMAIL PROTECTED]>\n";

mail ($recipient, $subject, $message, $extra);

echo "Email has been sent...";
echo "</body></html>";
?>
----------------------------------------------------------------------------
------------------------------------------------------


Thanks for your support
Marc



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to