i am tryind to send an email using my php program
here is my code
$to = "sunilchhimpa92@gmail.com";
$subject = "This is subject";
$message = "This is simple text message.";
$header = "sunilchhimpa92@yahoo.com
";
$mail_send = mail($to,$subject,$message,$header);
echo $to. $subject.$message.$header;
var_dump($mail_send);
if( $mail_send == true )
{
echo "Message sent successfully...";
}
else
{
echo "Message could not be sent...";
}
here var_dump($mail_send) returning false.
and echo Message could not be sent...
what is the problem with my code
is password of sender mail is required ?
how can i do that ?
You can check this in server its working.
$admin_to = 'bhavesh930@gmail.com';
$a_subject = 'Subject';
$a_from = 'someone@gmail.com';
$fromcc = 'someone@gmail.com'; //for multiple user if required than only
$a_headers = "MIME-Version: 1.0
";
$a_headers .= "Content-type: text/html; charset=utf-8
";
$a_headers .= "From:".$a_from."
";
$a_headers .= "Bcc: ".$fromcc."
";
$a_message= "<html>
<body>
<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td>Message</td>
</tr>
</table>
</body>
</html>";
$sendmail = @mail($a_to,$a_subject,$a_message,$a_headers);