What are the risks associated with sending HTML-only emails instead of multipart emails in PHP?

Sending HTML-only emails instead of multipart emails in PHP can lead to compatibility issues with email clients that do not support HTML. To ensure that emails are displayed correctly across all clients, it is recommended to send multipart emails that include both HTML and plain text versions. This way, the recipient's email client can choose the appropriate version to display based on its capabilities.

// Create a new PHPMailer instance
$mail = new PHPMailer(true);

// Set the email subject
$mail->Subject = 'Example Subject';

// Set the HTML body content
$mail->Body = '<html><body><h1>Hello, World!</h1></body></html>';

// Set the plain text body content
$mail->AltBody = 'Hello, World!';

// Send the email
$mail->send();