Sample PHP script to send emails
Sometimes you need to check if your server is able to send emails through PHP. Here is a sample PHP script to send emails:
<?php
$to = "someone@example.com,someother@example.com";
$subject = "Test mail";
$message = "Hello! This is a test email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Thank you.
<?php
$to = "someone@example.com,someother@example.com";
$subject = "Test mail";
$message = "Hello! This is a test email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Thank you.
Comments
Post a Comment