Hi guys,
I'm new to php.
how to send email in php. i have tried some code which is available on websites, but i'm not getting any email.
please help me guys.
Thanks
What I have tried:
$to = "abdulsubhan.it@gmail.com";
$subject = "Sent mail from php";
$message = "This is HTML message.";
$message .= "
This is headline.
";
$header = "From:abc@somedomain.com \r\n";
$header = "Cc:subhani.029@gmail.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...Error Encountered!";
}
?>
Success message is coming but not email.
i'm little bit confused.
this php code is not having any smtp variables, from email-password, nothing...
Directly will send this email?