How to Send Email using PHP mail() Function

PHP makes use of mail() function to send an email. The PHP mail function has the following basic syntax

mail(to, subject, message, headers, parameters);

<?php
$to = "info@domain.com";
$to = "info@domain.com, info2@domain.com"; \\Multiple Recipients
$subject = "This is test subject";
$message = "This is Test message.";

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

$headers .= 'From: ' . "\r\n";
$headers .= 'Cc: test2@domain.com' . "\r\n";
$headers .= 'Bcc: test3@domain.com' . "\r\n";

mail($to,$subject,$message,$headers);