What is the function used in PHP to send emails and what parameters does it require?

To send emails in PHP, you can use the `mail()` function. This function requires at least three parameters: the recipient's email address, the subject of the email, and the message body. Optionally, you can include additional headers and parameters to customize the email further.

$to = 'recipient@example.com';
$subject = 'Hello from PHP';
$message = 'This is a test email sent from PHP.';
$headers = 'From: sender@example.com';

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