Atozed Forums
IMAP.AppendMsg and AMBName - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Indy (https://www.atozed.com/forums/forum-8.html)
+--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html)
+--- Thread: IMAP.AppendMsg and AMBName (/thread-2158.html)



IMAP.AppendMsg and AMBName - luigisic - 11-29-2020

Hello,

  I sent a message with a TidSMTP.

Now I wish save the message in the online server. To do this I try:

Code:
IMAP.AppendMsg(AMBName, MailMessage, []);


But AMBName in my server is 'INBOX.Inviata' but in other server is 'SENT' or 'INBOX.SENT' and so on.

There is a method to pass only one international AMBName valid for all servers?

Thanks


RE: IMAP.AppendMsg and AMBName - rlebeau - 11-30-2020

(11-29-2020, 05:08 PM)luigisic Wrote: But AMBName in my server is 'INBOX.Inviata' but in other server is 'SENT' or 'INBOX.SENT' and so on.

There is a method to pass only one international AMBName valid for all servers?

All IMAP servers are required to recognize ‘INBOX’ (case insensitive) for the primary inbox. Beyond that, everything else is server-specific. You would have to request the actual mailbox list from the server, such as with TIdIMAP4.ListMailBoxes() (which was recently discovered to be slightly buggy).

There is a feature in IMAP to identify certain “special-use” mailboxes, like SENT, but unfortunately TIdIMAP4 does not implement support for that feature at this time. So you will likely have to implement that command manually.