Do not delete Draft items manually when sending
authorThomas
Mon, 30 Nov 2020 16:19:39 +0100
changeset 3355 a9d1f2d7110c
parent 3354 886a5855f5ef
child 3367 217dc5e98779
Do not delete Draft items manually when sending
CryptableMailItem.cs
--- a/CryptableMailItem.cs	Mon Nov 30 12:35:22 2020 +0100
+++ b/CryptableMailItem.cs	Mon Nov 30 16:19:39 2020 +0100
@@ -398,35 +398,6 @@
                 throw;
             }
 
-            Outlook.Folder folder = null;
-            Outlook.Items draftItems = null;
-            Outlook.MailItem mailItem = null;
-
-            try
-            {
-                folder = Globals.ThisAddIn.GetPEPStoreDraftsFolder();
-                draftItems = folder?.Items;
-
-                for (int i = 1; i <= draftItems.Count; i++)
-                {
-                    mailItem = draftItems[i] as Outlook.MailItem;
-                    if (mailItem.ConversationIndex == this.internalMailItem.ConversationIndex)
-                    {
-                        mailItem.PermanentlyDelete();
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                Log.Error("MailItem_Write: Error getting draft item." + ex.ToString());
-            }
-            finally
-            {
-                mailItem = null;
-                folder = null;
-                draftItems = null;
-            }
-
             this.HasBeenSent = true;
         }