setDate(gmdate('Y-m-d H:i:s')); $mm->setSubject('Hello World!'); /** @var WBMail_Mime_Part_Address */ $addrFrom = WBClass::create('WBMail_Mime_Part_Address'); $addrFrom->setForename('Mime-Mailer'); $addrFrom->setSurname('Wombat'); $addrFrom->setEmailAddress('wombat@exit0.net'); $mm->setFrom($addrFrom); $addrRcpt = WBClass::create('WBMail_Mime_Part_Address'); $addrRcpt->setForename('Tommy'); $addrRcpt->setSurname('Atkins'); $addrRcpt->setEmailAddress('tommyatkins@example.com'); $mm->setRcpt($addrRcpt); $mm->setPlainBody('Hi There, How are you today?'); $mm->setHtmlBody('
,How are you today?
'); /** @var WBMail_Mime_Part_Attachment */ // $att = WBClass::create('WBMail_Mime_Part_Attachment'); // $att->setData(file_get_contents(WBParam::get('wb/dir/base') . '/htdoc/s/px.gif')); // $att->setCid('px-gif'); // $att->setMime('image/gif'); // $att->setName('pixel.gif'); // $mm->addAttachment($att); echo '' . var_export($mm, true) . '' . "\n"; /** @var WBMail_Mime_Storage_String */ $ms = WBClass::create('WBMail_Mime_Storage_String'); $ms->setMimeMail($mm); $header = array(); $body = $ms->saveToString($header); // $str = $ms->get(); echo "
' . print_r($header, true) . '' . "\n"; echo htmlspecialchars($body); echo "