public static void Run() { // Create an instance of the ImapClient class ImapClient client = new ImapClient(); // Specify host, username and password, and set port for your client client.Host = "imap.gmail.com"; client.Username = "******"; client.Password = "******"; client.Port = 993; client.SecurityOptions = SecurityOptions.Auto; try { // ExStart:DeletingAndRenamingFolders // Delete a folder and Rename a folder client.DeleteFolder("foldername"); client.RenameFolder("foldername", "newfoldername"); // ExEnd:DeletingAndRenamingFolders client.Dispose(); } catch (Exception ex) { Console.Write(Environment.NewLine + ex); } }
public static void Run() { //ExStart:RenamingFolders // Create an instance of the ImapClient class ImapClient client = new ImapClient(); // Specify host, username and password, port and SecurityOptions for your client client.Host = "imap.gmail.com"; client.Username = "******"; client.Password = "******"; client.Port = 993; client.SecurityOptions = SecurityOptions.Auto; try { // Rename a folder and Disconnect to the remote IMAP server client.RenameFolder("Aspose", "Client"); client.Dispose(); } catch (Exception ex) { Console.Write(Environment.NewLine + ex); } //ExEnd:RenamingFolders Console.WriteLine(Environment.NewLine + "Renamed folders on IMAP server."); }
private void btnRun_Click(object sender, EventArgs e) { // Create an imapclient with host, user and password ImapClient client = new ImapClient(); client.Host = this.HostInput.Text; client.Username = this.Username.Text; client.Password = this.Password.Text; client.ConnectionProtocols = ConnectionProtocols.Ssl; client.Port = int.Parse(this.PortInput.Text); client.Connect(); // Create a new folder client.CreateFolder("E-iceblue1"); // Delete a folder client.DeleteFolder("Test"); // Rename a folder client.RenameFolder("E-iceblue", "E-iceblue2"); MessageBox.Show("Completed"); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_IMAP(); string dstEmail = dataDir + "1234.eml"; //Create an instance of the ImapClient class ImapClient client = new ImapClient(); //Specify host, username and password for your client client.Host = "imap.gmail.com"; // Set username client.Username = "******"; // Set password client.Password = "******"; // Set the port to 993. This is the SSL port of IMAP server client.Port = 993; // Enable SSL client.SecurityOptions = SecurityOptions.Auto; try { // Rename a folder client.RenameFolder("Aspose", "Client"); //Disconnect to the remote IMAP server client.Disconnect(); } catch (Exception ex) { System.Console.Write(Environment.NewLine + ex.ToString()); } Console.WriteLine(Environment.NewLine + "Renamed folders on IMAP server."); }