Copying a sent Zend_Mail message into a folder?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Copying a sent Zend_Mail message into a folder?

Kevin Jordan
I'm not seeing any way currently to copy a sent Zend_Mail message into an IMAP folder or equivalent.  I could save the string part and append it directly in that way, but that wouldn't work for HTML messages or ones with attachments correct?  Otherwise appendMessage takes a Zend_Mail_Message object which isn't compatible with a Zend_Mail object.  So how does one convert one to the other?
Reply | Threaded
Open this post in threaded view
|

Re: Copying a sent Zend_Mail message into a folder?

ritesh83
Hi Kevin,

This is Ritesh here.
Did you find a solution to the problem?
Even I need to save sent messages using Zend Mail.
The mail server I'm using is Plesk.
Please do let me know.

Thanks,
Ritesh


Kevin Jordan wrote
I'm not seeing any way currently to copy a sent Zend_Mail message into an IMAP folder or equivalent.  I could save the string part and append it directly in that way, but that wouldn't work for HTML messages or ones with attachments correct?  Otherwise appendMessage takes a Zend_Mail_Message object which isn't compatible with a Zend_Mail object.  So how does one convert one to the other?
Reply | Threaded
Open this post in threaded view
|

Re: Copying a sent Zend_Mail message into a folder?

Kevin Jordan

ritesh83 wrote
Hi Kevin,

This is Ritesh here.
Did you find a solution to the problem?
Even I need to save sent messages using Zend Mail.
The mail server I'm using is Plesk.
Please do let me know.

Thanks,
Ritesh


Kevin Jordan wrote
I'm not seeing any way currently to copy a sent Zend_Mail message into an IMAP folder or equivalent.  I could save the string part and append it directly in that way, but that wouldn't work for HTML messages or ones with attachments correct?  Otherwise appendMessage takes a Zend_Mail_Message object which isn't compatible with a Zend_Mail object.  So how does one convert one to the other?
Well, I think if you can convert it to a string that can be appended to an IMAP folder using appendMessage, then you can.  There's still no direct way to do it and in fact, I don't believe anything like toString on the Zend_Mail object will get you the correct string.  Although it has been a few versions since I last tried to append a Zend_Mail object to an IMAP folder and I believe that was the problem I had.  I've also started using JavaMail as more of my stuff is becoming Java as opposed to PHP.  Zend Mail could learn a few things from that API as it's pretty well written and does allow you to do this kind of stuff.
Reply | Threaded
Open this post in threaded view
|

Re: Copying a sent Zend_Mail message into a folder?

ritesh83
Thanks Kevin

Kevin Jordan wrote
ritesh83 wrote
Hi Kevin,

This is Ritesh here.
Did you find a solution to the problem?
Even I need to save sent messages using Zend Mail.
The mail server I'm using is Plesk.
Please do let me know.

Thanks,
Ritesh


Kevin Jordan wrote
I'm not seeing any way currently to copy a sent Zend_Mail message into an IMAP folder or equivalent.  I could save the string part and append it directly in that way, but that wouldn't work for HTML messages or ones with attachments correct?  Otherwise appendMessage takes a Zend_Mail_Message object which isn't compatible with a Zend_Mail object.  So how does one convert one to the other?
Well, I think if you can convert it to a string that can be appended to an IMAP folder using appendMessage, then you can.  There's still no direct way to do it and in fact, I don't believe anything like toString on the Zend_Mail object will get you the correct string.  Although it has been a few versions since I last tried to append a Zend_Mail object to an IMAP folder and I believe that was the problem I had.  I've also started using JavaMail as more of my stuff is becoming Java as opposed to PHP.  Zend Mail could learn a few things from that API as it's pretty well written and does allow you to do this kind of stuff.