note 54491 rejected from function.mail by betz
| From: | betz@php.net | Date: | Wed, 06 Jul 2005 05:58:59 +0000 |
| Subject: | note 54491 rejected from function.mail by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91518@lists.php.net to get a copy of this message | ||
Note Submitter: ammar01_pk at yahoo dot com
----
I am using the following function for mailing
<?
function MAIL_USER($fromname, $fromaddress, $toaddress, $subject, $message){
// Copyright ? 2005 ECRIA LLC, http://www.ECRIA.com
// Please use or modify for any purpose but leave this notice unchanged.
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From: \"".$fromname."\"
<".$fromaddress.">\n";
return mail($toaddress, $subject, $message, $headers);
}
?>
Now I am using this function to generate mails I used it as follows
<?
$frname = "Ammar Hassan";
$fraddr = "ammar@local.com";
$sub = "This is a test mail";
$message = "This is the message that will be going to the recipents with thier $email and
$u_pwd";
MAIL_USER($frname, $fraddr, $email, $sub, $message);
?>
but it ends up in the following error
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for
hassanammar@hotmail.com in (FileName and line) points towards the return mail($toaddress, $subject,
$message, $headers);
Can any one sort it out?