To send mail for php...



Hi...

I am trying to send email from php. I am running apache with mod php on
my development environment.

I am not sure what I need to configure to be able to send the email. I
am using the code:

if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}

i am always getting a FAIL response.

do i need to confiure a email server? can i just point php to use an
existing email server? where can i configure this?

any help would be apreciated.

------Configuration of my PHP.ini-----
SMTP = localhost

sendmail_from = my-email@xxxxxxxxxxxxxx

sendmail_path = /usr/sbin/sendmail

------My System:-----
Suse 10

-----My code:------
<?php
$to = "recipient@xxxxxxxxxxx";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

Thanks...

.


Quantcast