Some email providers like gmail do not support css classes when sending html email through php, so I thought i would store css classes or even full codes in php strings so I can use them multiple times. For example
$leftbox = '<div style="background:#333;border:1px solid #000;padding:5px 2px;float:left;width:200px;">';
$rightbox = '<div style="background:#FFF;border:1px solid #CCC;padding:5px 2px;float:right;width:200px;">';
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$message = '<html><body style="background:#000;margin:auto;width:400px;">';
$message .= $leftbox.'Name </div>'.$rightbox.' Content 1</div>';
$message .= $leftbox.'Addresss </div>'.$rightbox.' Content 2</div>';
$message .= $leftbox.'Mobile </div>'.$rightbox.' Content 3</div>';
mail("emailadress@email.com", "Subject", $message, $headers);
Is this a good idea, or is there any other good ways to do this if you want a good looking html email sent with php?