Setting up mail server


#1

Hello Friends,

Iam very new to LAMP installtion,
I have congifured the sendmail and tested using cmd and it is sending the mail but when i send the mail from php with simple mail() funcion it is not sending any mail but it says mail sent.

Can anyone please help me out in this. ?

Warm Regards


#2

What code are you using? Are you checking the mail() function’s return value?


#3

Here is my php code

[php]<?php
mail("mymail@gmail.com",“Subject”,“Content”);
if (mail)
{
echo “mail sent…”;
}
else
{
echo “unable to send mail”;
}
?>[/php]

OUTPUT : mail sent…
but i have not received any mails…

Mod Edit: Added [php] tags for readability.


#4

Try the following:

[php]<?php
if (mail("mymail@gmail.com",“Subject”,“Content”)) {
echo “mail sent…”;
} else {
echo “unable to send mail”;
}
?>[/php]


#5

Hi
Thnaks for the Prompt reply,

This time i get the message "unable to send mail "

Regards