Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay in C:\Inetpub\wwwroot\deliver_mailing.php on line 58
Line 58 in my code is this one
$d_response[$id] = mail($d->firstChild->nodeValue, $subject, $message, $headers);
I m getting this error message when sending out mass emails. Here is the coding that i have , please look at this and help me
$deliveries = $xml->getElementsByTagName("delivery");
$i = 0;
$d_response = array();
if ($deliveries->length > 0)
{
$body = $xml->getElementsByTagName("body")->item(0)->childNodes->item(0)->nodeValue;
$subject = $xml->getElementsByTagName("subject")->item(0)->childNodes->item(0)->nodeValue;
while ($deliveries->item($i))
{
$d = $deliveries->item($i);
$id = $d->getAttribute("id");
$uid = $d->getAttribute("uid");
$this_text = str_replace('<!did>', $id, $body);
$this_text = str_replace('<!duid>', $uid, $this_text);
$message = "<html>\n";
$message .= "<body>$this_text</body></html>";
$mailer = new htmlMimeMail();
$mailer->setSubject($subject);
$mailer->setHTML($this_text);
if (strstr($subject, "Knowledge Network"))
{
$from = "Newsletter <info@me.org>";
$reply = "Newsletter <info@me.org>";
}
else
{
$from = "Newsletters <request@me.org>";
$reply = "Newsletters <request@me.org>";
}
$headers = "From: $from\n";
$headers .= "Reply-To: $reply\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html\n";
$d_response[$id] = mail($d->firstChild->nodeValue, $subject, $message, $headers);
set_time_limit(30);
$i++;
}
$url = "http://www.me.org/update_delivery.php?mailing=".$_REQUEST['mailing']."&&pass=".md5("mnjk23")."&&";
$i = 0;
foreach ($d_response as $id => $result)
{
$url .= "id_$i=".$id."&&r_$i=".$result."&&";
$i++;
}