PDA

View Full Version : Mail sending error! Please help.



ramki067
11-29-2010, 09:48 AM
Hi,

I'm getting the below error while sending mail.

Error:

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for zyz@slkkd.com in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mail.php on line 39


Code:

if (isset($_POST["submit"])) {

$to = strip_tags($_POST["to"]);
$sub = strip_tags($_POST["sub"]);
$feedback = strip_tags($_POST["feedback"]);
$from = strip_tags($_POST["from"]);
$to= "xyz@gmail.com";
$sendto = $to;
$subject = $sub;
$message = $feedback;
$headers ="MIME-Version:1.0\r\n";
$headers .="content-type:text/html; Charset=iso-8859-1\r\n";
$headers .="From: <" . "$from" . ">\r\n";
$headers .="X-Sender: <" . "$sendto" . ">\r\n";
$headers .="Return-Path: <" . "$sendto" . ">\r\n";
$headers .="Error-To: <" . "$sendto" . ">\r\n";
$sendto = trim($sendto);
$themail= mail($sendto, $subject, $message, $headers) ;


}


Kindly help.
Thanks,
Ramki

abduraooft
11-29-2010, 10:30 AM
http://email.about.com/cs/standards/a/smtp_error_code_2.htm says
550 - The requested command failed because the user's mailbox was unavailable (for example because it was not found, or because the command was rejected for policy reasons).