Advertisement
Guest User

Untitled

a guest
Apr 19th, 2012
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. $mh = Loader::helper('mail');
  2.  
  3. $zmo = $mh->getMailerObject();
  4. $zm = $zmo['mail'];
  5. $zm->setType(Zend_Mime::MULTIPART_RELATED);
  6. $zm->setBodyText('This is the text of the mail.');
  7. $zm->setFrom('noreplay@server.net', 'Some Sender');
  8. $zm->addTo('sendTo@gmail.com', 'Some Recipient');
  9. $zm->setSubject('Zend TestSubject');
  10.  
  11. $fh = Loader::helper('file');
  12. $image = $fh->getContents( File::getByID(19) );
  13.  
  14. $at = new Zend_Mime_Part($image);
  15. $at->type        = 'image/jpeg';
  16. $at->disposition = Zend_Mime::DISPOSITION_INLINE;
  17. $at->encoding    = Zend_Mime::ENCODING_BASE64;
  18. $at->filename    = 'justFileName.jpg';
  19. $zm->addAttachment($at);
  20.  
  21. $zm->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement