public void DeleteMessage(MailMessage message, bool permanent = false) { message.Flags |= MailFlags.Deleted; // marke the message as deleted //first simuate deleting the item by moving it to the deleted folders if (!DeletedItems.Contains(message)) { DeletedItems.Add(message); } if (InboxItems.Contains(message)) { InboxItems.Remove(message); } if (DraftItems.Contains(message)) { DraftItems.Remove(message); } if (SentItems.Contains(message)) { SentItems.Remove(message); } if (permanent) { if (DeletedItems.Contains(message)) { DeletedItems.Remove(message); } } }
public void ViewSentItems() { panel_body.Controls.Clear(); SentItems ucClass = new SentItems(); panel_body.Controls.Add(ucClass); InactiveAllnav(); label_sentItems.ForeColor = System.Drawing.Color.DeepSkyBlue; }
public void SendMessage(MailMessage message) { if ((message.Flags & MailFlags.Draft) == MailFlags.Draft) { message.Flags &= ~MailFlags.Draft; //remove the draft flag if it was sent } message.DateSent = DateTime.Now; message.Flags = MailFlags.Seen; SentItems.Add(message); }