*/
$text_message = "This is an HTML message. Please use an HTML capable mail program to read this message.";
$email_message->CreateQuotedPrintableTextPart($email_message->WrapText($text_message), "", $text_part);
/*
 *  Multiple alternative parts are gathered in multipart/alternative parts.
 *  It is important that the fanciest part, in this case the HTML part,
 *  is specified as the last part because that is the way that HTML capable
 *  mail programs will show that part and not the text version part.
 */
$alternative_parts = array($text_part, $html_part);
$email_message->CreateAlternativeMultipart($alternative_parts, $alternative_part);
/*
 *  All related parts are gathered in a single multipart/related part.
 */
$related_parts = array($alternative_part, $image_part, $background_image_part);
$email_message->AddRelatedMultipart($related_parts);
/*
 *  One or more additional parts may be added as attachments.
 *  In this case a file part is added from data provided directly from this script.
 */
$attachment = array("Data" => "This is just a plain text attachment file named attachment.txt .", "Name" => "attachment.txt", "Content-Type" => "automatic/name", "Disposition" => "attachment");
$email_message->AddFilePart($attachment);
/*
 *  The message is now ready to be assembled and sent.
 *  Notice that most of the functions used before this point may fail due to
 *  programming errors in your script. You may safely ignore any errors until
 *  the message is sent to not bloat your scripts with too much error checking.
 */
$error = $email_message->Send();
if (strcmp($error, "")) {
    echo "Error: {$error}\n";