What I'm trying to do is to simply make the mail() function of PHP work flawlessly.
I've installed sendmail with
Code:
apt-get install sendmail
It installed without any problems and auto-configured everything.
The weirdness starts here. I've created a simple php file to test it.
The contents are as follows:
Code:
<?php
$to ='me@example.com';
$subject = 'Hi!';
$message = 'Sample Message';
$headers = 'From : you@somedomain.com'."\r\n".
'Reply-To: someone@somedomain.com';
if (mail($to,$subject,$message,$headers)) {
print "Success!";
}else{
print "Failed :(";
}
?>
Now, the mail successfully arrives at the destination, no problem there. But the php script never gets terminated. It just keeps running and running until the process is automatically killed. Then the page displays a "500 Internal Server Error".
I do know a few things about sendmail, but never encountered an error like this before. Any ideas? Thanks!