To send mail for php...
- From: "Carp Diem" <romildo.junior@xxxxxxxxx>
- Date: 22 May 2006 08:05:06 -0700
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...
.
- Prev by Date: To send mail for php...
- Next by Date: Re: PHP_SELF in Buttonproblem in PHP5
- Previous by thread: To send mail for php...
- Index(es):