hello i am new to php.
i want to email to client from my website.
but i am not able to send email .
it all time executes statement
"Mail send failure - message not sent"
as per my code given below.
please help me to solve this problem or alternatively please provide some sample code .
following is my sample code for sending email.
[code=php]
<?php
$to = 'example@yahoo. com';
$subject = 'the subject';
$from = 'example@yahoo. com';
$message = 'hello';
if(mail($to, $subject, $message, "From: $from"))
echo "Mail sent";
else
echo "Mail send failure - message not sent";
?>
[/code]
i want to email to client from my website.
but i am not able to send email .
it all time executes statement
"Mail send failure - message not sent"
as per my code given below.
please help me to solve this problem or alternatively please provide some sample code .
following is my sample code for sending email.
[code=php]
<?php
$to = 'example@yahoo. com';
$subject = 'the subject';
$from = 'example@yahoo. com';
$message = 'hello';
if(mail($to, $subject, $message, "From: $from"))
echo "Mail sent";
else
echo "Mail send failure - message not sent";
?>
[/code]
Comment