On 10 Jul 2007, at 09:06, Justin Giboney wrote:

Is there anything special that a server needs to have to run the mail() function?
I have apache running on a mac (10.4.10) with no mail/smtp.

this code (from various internet sources), seems to work, but I never get a message

<?php
$to = "[EMAIL PROTECTED]";
$subject = "Test mail";
$message = "Hello! This is a simple email messages.";
$from = "[EMAIL PROTECTED]";
$headers = "From: $from";
if(mail($to,$subject,$message,$headers)) {
echo "An e-mail was sent to $to with the subject: $subject";
} else {
echo "There was a problem sending the mail. Check your code and make sure that the e-mail address $to is valid";
}
?>



Just to add to the other comments. I ran into this same problem when developing locally. I did some googling and looking on the Apple discussion boards and learned what has already been said, mail() just passes of to the local mail server (usually sendmail) which on a Mac is disabled by default. I decided it was not worth it in my case to enable or install sendmail. I just wait until I commit the changes to the live server to test the mail functionality.

Jonathan

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to