note 54490 added to ref.mail

From: Date: Wed, 06 Jul 2005 05:02:16 +0000
Subject: note 54490 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-91500@lists.php.net to get a copy of this message
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? ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54490 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54490&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54490&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91500) next »