Write a PHP Program to send a mail from php Script



Write a PHP Program to send a mail from php Script

<!DOCTYPE html>
<html>
<head>
          <title>Practical-10</title>
</head>
<body>
<?php
error_reporting(0);
$to="me@localhost";
$subject="This is Subject Subject";
$message="<b>This is PHP message.</b>";
$message="<h1>This is Headline.</h1>";
$header="Fom:abc@somedomain.com \r\n";
$header="Cc:afgh@somedomain.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==false)
{
          echo "Message Sent Successfully.....";
}
else
{
          echo "Message could not be sent.....";
}
?>
</body>
</html>

OUTPUT:-

Message Sent Successfully.....



Comments