How can PHP be configured to send emails in plain text format rather than HTML format for better compatibility with certain email clients like Outlook?

To configure PHP to send emails in plain text format rather than HTML format for better compatibility with certain email clients like Outlook, you can set the content type of the email to "text/plain" in the email headers. This will ensure that the email is sent as plain text rather than HTML.

<?php
$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a plain text email.";
$headers = "From: sender@example.com\r\n";
$headers .= "Content-Type: text/plain; charset=ISO-8859-1\r\n";

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