Example #1
0
        /// <summary>
        /// Does the mailing.
        /// </summary>
        public static void DoMail()
        {
            MailList.Load();
            Thread.Sleep(1000);
            MouseHelper.Hook();
            if (!MakeMailReady())
            {
                MouseHelper.ReleaseMouse();
                return;
            }
            AddedItemsStatus answer = ClickItems(true, 12);
            bool             done   = false;

            while (true)
            {
                switch (answer)
                {
                case AddedItemsStatus.ClickedAll:
                    Logging.Write("Mail full sending");
                    MailFrame.ClickSend();
                    Thread.Sleep(3500);
                    if (LazySettings.MacroForMail)
                    {
                        SetMailNameUsingMacro();
                    }
                    else
                    {
                        MailFrame.SetReceiverHooked(LazySettings.MailTo);
                    }
                    Thread.Sleep(500);
                    break;

                case AddedItemsStatus.ClickedSomething:
                    Logging.Write("Mail partly full sending and stopping loop");
                    MailFrame.ClickSend();
                    Thread.Sleep(500);
                    done = true;
                    break;

                case AddedItemsStatus.Error:
                    //Continue the loop as it could just be a single read error.
                    break;

                default:
                    done = true;
                    break;
                }
                if (done)
                {
                    break;
                }
                Thread.Sleep(1000);
                Application.DoEvents();
                answer = ClickItems(false, 12);
            }
            MailFrame.Close();
            MouseHelper.ReleaseMouse();
            CloseAllBags();
            Logging.Write("Brok loop with: " + answer);
        }
Example #2
0
 /// <summary>
 /// Targest the mailbox, clicks the send mail tab and types to name we should send to.
 /// </summary>
 private static bool MakeMailReady()
 {
     try
     {
         TargetMailBox();
         Thread.Sleep(2000);
         OpenAllBags();
         Thread.Sleep(500);
         if (LazySettings.MacroForMail)
         {
             return(SetMailNameUsingMacro());
         }
         if (!ClickSendMailTab())
         {
             return(false);
         }
         Thread.Sleep(500);
         MailFrame.SetReceiverHooked(LazySettings.MailTo);
         Thread.Sleep(500);
         return(true);
     } catch (Exception e)
     {
         Logging.Write("Exception MakeMailReady: " + e);
         return(false);
     }
 }
Example #3
0
 private static bool SetMailNameUsingMacro()
 {
     MailFrame.ClickMailFrame();
     Thread.Sleep(1000);
     MailFrame.ClickInboxTab();
     Thread.Sleep(500);
     KeyHelper.SendKey("MacroForMail");
     Thread.Sleep(500);
     if (!ClickSendMailTab())
     {
         return(false);
     }
     Thread.Sleep(500);
     return(true);
 }
Example #4
0
 private static bool ClickSendMailTab()
 {
     MailFrame.ClickMailFrame();
     Thread.Sleep(1000);
     MailFrame.ClickSendMailTabHooked();
     Thread.Sleep(500);
     if (!MailFrame.CurrentTabIsSendMail)
     {
         Thread.Sleep(500);
         MailFrame.ClickSendMailTabHooked();
         Thread.Sleep(500);
         if (!MailFrame.CurrentTabIsSendMail)
         {
             Logging.Write("Could not find mail frame");
             return(false);
         }
     }
     return(true);
 }