PHP program to send a text e-mail message
<?php
//PHP program to send a text message using e-mail.
ini_set("sendmail_from", "testmail@includehelp.com");
$header = "From:testmail@includehelp.com \r\n";
$to = "reciever@gmail.com";
$sub = "Subject of the mail";
$msg = "Hello message from email";
$isSuccess = mail($to, $sub, $msg, $header);
if ($isSuccess == true)
{
printf("Email send successfully");
}
else
{
printf("Email sending failed");
}
?>
Output
If you pass the correct e-mail addresses then
it will print a "Email send successfully" message on the webpage.
