note 54490 rejected from ref.mail by betz
| From: | betz@php.net | Date: | Wed, 06 Jul 2005 05:58:43 +0000 |
| Subject: | note 54490 rejected from ref.mail by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91517@lists.php.net to get a copy of this message | ||
Note Submitter: hassanammar at hotmail dot com
----
Well I referred the Manual and while going through the comments I found the following function
function MAIL_NVLP($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_NVLP($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 anyone sort it out?