How to Send Mail Using PHP
Today I will learn How to Send Mail Using PHP. I will give you a simple example of How to Send Mail Using PHP. PHP mail() function requires three mandatory arguments that specify the recipient’s email address. If you have sent a mail using PHP. you can use a PHP mail() function.
Syntax
mail(to, subject, message, headers, parameters)
Example
<?php
$to = 'youremail@gmail.com';
$subject = 'PHP Sent Mail!';
$message = 'PHP Testing Mail!';
$headers = "From:info@domainname.com";
if (mail($to, $subject, $message, $headers)) {
echo "Success fully sent mail.";
} else {
echo "Something we are wrong!";
}
?>