问题
After sending the message with JavaMail by smtp, how to put it into the Sent folder(IMAP)? What about the non-english mail(ex: in Russian sent=отправленные)? Is there a way to get the name of the "sent" folder programmatically?
回答1:
Folder.appendMessages()
There's no standard name for the "sent" folder. Depending on the mail client being used, the folder might have a different name. There's an IMAP extension that would tell you which folder is the "sent" folder, but I don't think most servers support the extension.
回答2:
In general, the Sent Folder doesn't have a fixed name. Gmail, specifically supports 'special use extensions' for Folders. When you do a LIST to get the list of email boxes, it will tag the sent folder with a \Sent tag.
See Gmail's document for their implemented extensions.
来源:https://stackoverflow.com/questions/17619891/how-to-put-message-into-sent