What is the limitation of the mail() function in PHP in terms of the number of parameters it can accept?

The mail() function in PHP can accept up to three parameters: the recipient email address, the subject of the email, and the message body. If you need to include additional parameters such as headers or attachments, you can use the fourth parameter to specify additional headers. This allows you to customize the email further, but keep in mind that the mail() function has limitations in terms of the number of parameters it can accept.

$to = 'recipient@example.com';
$subject = 'Test Email';
$message = 'This is a test email.';
$headers = 'From: sender@example.com' . "\r\n" .
    'Reply-To: sender@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

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