*  Different parts need to be created before they can be added
 *  later to the message.
 *
 *  Parts can be created from files that can be opened and read.
 *  The data content type needs to be specified. The can try to guess
 *  the content type automatically from the file name.
 */
$image = array("FileName" => "http://www.phpclasses.org/graphics/logo.gif", "Content-Type" => "automatic/name", "Disposition" => "inline");
$email_message->CreateFilePart($image, $image_part);
/*
 *  Parts that need to be referenced from other parts,
 *  like images that have to be hyperlinked from the HTML,
 *  are referenced with a special Content-ID string that
 *  the class creates when needed.
 */
$image_content_id = $email_message->GetPartContentID($image_part);
/*
 *  Many related file parts may be embedded in the message.
 */
$image = array("FileName" => "http://www.phpclasses.org/graphics/background.gif", "Content-Type" => "automatic/name", "Disposition" => "inline");
$email_message->CreateFilePart($image, $background_image_part);
/*
 *  Related file parts may also be embedded in the actual HTML code in the
 *  form of URL like those referenced by the SRC attribute of IMG tags.
 *  This example is commented out because not all mail programs support
 *  this method of embedding images in HTML messages.
 *
 *  $image=array(
 *    "FileName"=>"http://www.phpclasses.org/graphics/elephpant_logo.gif",
 *    "Content-Type"=>"automatic/name",
 *  );