[imp] How to append message with Horde_Imap_Client_Socket->append() ?

Michael J Rubinsky mrubinsk at horde.org
Sat May 2 13:56:45 UTC 2015


Quoting Kristers Zariņš <sharrpenized at gmail.com>:

> class Horde_Imap_Client_Socket has this method defined:
>
> protected function _append(Horde_Imap_Client_Mailbox $mailbox, $data,
> $options)
>
> However, it doesn't give any hints about how to structure $data and what
> are $options. Can somebody give a short example how to save message in
> "Drafts" mailbox?

You are better off looking at the base class for the phpdoc of the  
Horde_Imap_Client_Base::append() method. This tells you exactly what  
data structure $data is.



> I need to set fields like "from", "cc", "bcc" and attachments.

You don't "set" these values with append. This method is for adding a  
complete message to the specified mailbox. I.e., you provide the full  
string (or stream) representation of the email message. If you need to  
build a message or add/alter some of the message headers, you should  
use the Horde_Mime package to perform this.



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5869 bytes
Desc: S/MIME Signature
URL: <http://lists.horde.org/archives/imp/attachments/20150502/8250730c/attachment.bin>


More information about the imp mailing list