What is the function used to send an email in PHP?

To send an email in PHP, you can use the `mail()` function. This function takes parameters for the recipient's email address, the subject of the email, the message content, and optional additional headers. Make sure your server is properly configured to send emails, and be aware that the `mail()` function may not work on all servers, especially if they have strict email sending policies.

$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email.";
$headers = "From: sender@example.com";

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