|
-
June 4th, 2008, 01:43 PM
#3
Senior Member
 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.
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
Similar Threads
-
By ThePreacher in forum Miscellaneous Security Discussions
Replies: 17
Last Post: December 14th, 2006, 09:37 PM
-
By Vorlin in forum Other Tutorials Forum
Replies: 3
Last Post: June 15th, 2004, 10:25 PM
-
By journy101 in forum Newbie Security Questions
Replies: 1
Last Post: May 1st, 2003, 06:16 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|