private void send(Outlook.MailItem mail)
 {
     ga("clicked");
     string name = mail.Sender.Address;
     //DialogResult result = MessageBox.Show("Send HK response to " + name,"Confirmation...", MessageBoxButtons.YesNo);
     //if (result == DialogResult.Yes)
     {
         // MessageBox.Show(ThisAddIn.User);
         Outlook.MailItem reply = mail.Reply();
         try
         {
             if (template == null)
             {
                 fetch();
             }
             sent           = false;
             reply.CC       = template.cc;
             reply.HTMLBody = getBody();
             reply.Subject  = template.subject;
             reply.Display();
             ((Outlook.ItemEvents_10_Event)reply).Send  += Ribbon1_Send;
             ((Outlook.ItemEvents_10_Event)reply).Close += Ribbon1_Close;
         }
         catch (Exception)
         {
             MessageBox.Show("Could not Reply");
         }
     }
 }
示例#2
0
        private void send(Outlook.MailItem mail)
        {
            string name = mail.Sender.Address;

            //DialogResult result = MessageBox.Show("Send HK response to " + name,"Confirmation...", MessageBoxButtons.YesNo);
            //if (result == DialogResult.Yes)
            {
                // MessageBox.Show(ThisAddIn.User);
                Outlook.MailItem reply = mail.Reply();
                try
                {
                    if (template == null)
                    {
                        fetch();
                    }

                    reply.CC = template.cc;

                    reply.HTMLBody = getBody();
                    reply.Subject  = template.subject;
                    reply.Display();
                }
                catch (NullReferenceException)
                {
                    MessageBox.Show("Could not Reply");
                }
            }
        }
示例#3
0
 public static void AssignTicket(Outlook.MailItem mailItem, string email)
 {
     if (mailItem != null)
     {
         if (!Properties.Settings.Default.NoAssignConf)
         {
             DialogResult confirm = MessageBox.Show("Assign Ticket to " + email +
                                                    "?\nSubject: " + mailItem.Subject, "Spiceworks Outlook AddIn", MessageBoxButtons.YesNo);
             if (confirm == DialogResult.Yes)
             {
                 try
                 {
                     Outlook.MailItem newMsg = mailItem.Reply();
                     newMsg.Body = "#assign to " + email;
                     newMsg.Send();
                     if (Properties.Settings.Default.CloseMsg)
                     {
                         mailItem.Close(Outlook.OlInspectorClose.olPromptForSave);
                     }
                 }
                 catch (Exception e)
                 {
                     MessageBox.Show("Unable to assign ticket. Error: " + e.ToString()
                                     , "Spiceworks Outlook AddIn", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
         else
         {
             try
             {
                 Outlook.MailItem newMsg = mailItem.Reply();
                 newMsg.Body = "#assign to " + email;
                 newMsg.Send();
                 if (Properties.Settings.Default.CloseMsg)
                 {
                     mailItem.Close(Outlook.OlInspectorClose.olPromptForSave);
                 }
             }
             catch (Exception e)
             {
                 MessageBox.Show("Unable to assign ticket. Error: " + e.ToString()
                                 , "Spiceworks Outlook AddIn", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }
示例#4
0
 public static void CloseTicketWithResponse(Outlook.MailItem mailItem)
 {
     if (mailItem != null)
     {
         try
         {
             Outlook.MailItem newMsg = mailItem.Reply();
             newMsg.Body = "\n\n#close" + newMsg.Body;
             newMsg.Display();
             if (Properties.Settings.Default.CloseMsg)
             {
                 mailItem.Close(Outlook.OlInspectorClose.olPromptForSave);
             }
         }
         catch (Exception e)
         {
             MessageBox.Show("Unable to close ticket. Error: " + e.ToString()
                             , "Spiceworks Outlook Addin", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }