How to send Email using PHP?

Using PHP, we can send email to a particular email id. PHP has mail function and it helps to send mail.

PHP Mail

PHP mail takes three parameters. First parameter is to email, second parameter is subject and third parameter is message. 

<?php
$to="admin@gyanol.com";
$subject="Sample Mail Test";
$message="This is a sample email test";
mail($to, $subject, $message);
?>
Thats it. It will send an mail to the mentioned email id. 
How to send Email using PHP? How to send Email using PHP? Reviewed by Pixel Stream on December 10, 2019 Rating: 5

No comments:

Powered by Blogger.