-
June 4th, 2008, 12:28 PM
#1
Senior Member
PHP mail function and SMTP 501 error
Hi guys
I have this mail function in PHP
<code>
function send_email ($recipient, $from, $reply_address, $subject, $message){
ini_set('display_errors', '1');
error_reporting(E_ALL);
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= 'To:$recipient\r\n';
$headers .= 'From:<$from>\r\n';
//$headers .= 'Reply-To:$reply_address\r\n';
if(!mail($recipient, $subject, $message, $headers)){
return 'Mail function failed.';
}
else
{
return 'ok';
}
}
</code>
Whenever I call it it comes up with the next error:
Warning: mail(): SMTP server response: 501 Syntax error in forward path in E:\apache2triad\htdocs\i2card.co.uk\functions\email_function.php on line 15
From what I can understand, I made a mistake in setting up the header, but I am not sure which one is it.
Could someone point me in the right direction please?
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 Irongeek in forum The Security Tutorials Forum
Replies: 8
Last Post: April 27th, 2005, 04:44 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
-
By Sp1d3r-W0lf in forum The Security Tutorials Forum
Replies: 0
Last Post: December 27th, 2001, 05:31 PM
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
|
|