I've the following PHP code for sending e-mails with PHP mail() as HTML:
<?php
$to = "test@example.com";
$subject = "This is the subject";
$headers = "From: Me<test@exapmle.com>\r\n";
$headers .= "Return-Path: test@exapmle.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=utf-8\r\n";
$headers .= "X-Priority: 1\r\n";
$message = "This is my <b>message</b>!";
mail($to,$subject,$message,$headers);
?>
But I want to support plain text and HTML. HTML for things like bold font and plain text to show This is my message!
in non-html supporting email clients instead of This is my <b>message</b>!
.
How can I do this?
I read about boundary. Is that what I'm looking for? But if so, how to use it? I don't understand it.