note 54491 added to function.mail

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

« previous php.notes (#91501) next »