ImapCopyMessages Method (String, Boolean, String) |
Namespace: MailBee.ImapMail
public bool CopyMessages( string messageIndexSet, bool indexIsUid, string targetFolderName )
Exception | Condition |
---|---|
MailBeeException | An error occurred and ThrowExceptions is true. |
This sample copies all messages from the inbox folder to the Sent folder.
The sample assumes "Sent" folder had already been created in the past. To learn how to make sure the folder exists, see UploadMessage(MailMessage, String, String, DateTime) or UploadMessage(MailMessage, String, String, String) samples.
using System; using MailBee; using MailBee.ImapMail; class Sample { static void Main(string[] args) { Imap imp = new Imap(); // Connect to the server, login and select inbox. imp.Connect("imap.company.com"); imp.Login("jdoe@company.com", "secret"); imp.SelectFolder("INBOX"); // Copy all messages in Inbox into Sent. imp.CopyMessages(Imap.AllMessages, false, "Sent"); // Disconnect from the server. imp.Disconnect(); } }