XHTML input for PHPmailer
You may use a template.

$message = file_get_contents('path/to/your/html/template.html');


Then replace parts of it applying variables

// Defining variables
$variable1 = 'This will be a heading';
$variable2 = 'This will be a paragraph. Look at me, I\'m awesome!';

// Replace placeholders with my variables
$message = str_replace('%variable1%', $variable1, $message); 
$message = str_replace('%variable2%', $variable2, $message);


And finally pass it to PHPmailer

$mail-&gt;Body = $message;


In your HTML template reference variables as part of your body, nothing more than

&lt;h2&gt;%variable1%&lt;/h2&gt;
&lt;p&gt;%variable2%&lt;/p&gt;


You probably already know, but I'd suggest anyway to specify that the message contains HTML

$mail-&gt;IsHTML(true);         // specify that it is html
$mail-&gt;CharSet = "utf-8";    // avoid encoding issues