Quote Originally Posted by SirDice
The "To:" header isn't needed as that's already taken care of by the mail function. It's wrong anyway as it should be "RCPT TO:". "From:" is wrong too, that should be "MAIL FROM:". See RFC 2821 for the correct header syntax.

Thanks for your reply. I will go through the paper now.

Tried the changes you advised, but the error still appears.

Yet the function on top is derived from

<code>

function send_email($email,$format='text',$msg='',$subject='')
}

// send an email to the address $email in the format $format
// with contents $msg and subject $subject


global $fromname, $fromemail, $admin_email;

if($format!='text' && $format!='html')
{
return 'Invalid mail format!';
}
$headers='';

if($format=='html')
{
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
}
$headers .= "To: $email\r\n";
$headers .= "From: WebSite Admin <$admin_email>\r\n";

if(!mail($email, $subject, $msg, $headers))
{
return 'Mail function failed.';
}
else
{
return 'ok';
}
}

</code>


And that one is proven to be working fine on the other system. That is why I'm so confused

It's been ages since I last wrote one of these.