Ejemplo n.º 1
0
        public static void ActivateLicense(Model.IMailGoPG v_mailgo, string v_license_id, out bool v_request, out bool v_activate, out Model.IEmail v_email)
        {
            v_request  = false;
            v_activate = false;
            v_email    = new Model.MEmail();

            v_mailgo.Track.Debug("Start showing activation license");

            ActivateLicenseWF t_form   = new ActivateLicenseWF(v_mailgo, v_license_id);
            DialogResult      t_result = t_form.ShowDialog();

            v_mailgo.Track.Debug("Dialog result : " + t_result.ToString());

            if (t_result == DialogResult.OK)
            {
                v_activate = true;
            }
            else if (t_result == DialogResult.Ignore)
            {
                v_request = true;
                v_email.TO.AddRange(sm_request_email.TO.ToArray());
                v_email.Subject = sm_request_email.Subject;
                v_email.Body    = sm_request_email.Body;
            }

            v_mailgo.Track.Debug("Finish showing activation license");
        }
Ejemplo n.º 2
0
        private void cmdCheck_Click(object sender, EventArgs e)
        {
            this.m_mailgo.Activation.Option.CheckAllAddress = this.chkCheckAllToAddr.Checked;
            this.m_mailgo.Activation.Option.CheckCCLine     = this.chkCheckCCLine.Checked;
            this.m_mailgo.Activation.Option.CheckSameSuffix = this.chkCheckSameSuffix.Checked;

            Model.IEmail t_email  = new Model.MEmail();
            bool         t_cancel = false;

            t_email.Sender = this.txtSender.Text;
            t_email.TO.AddRange(this.txtTo.Text.Split(new char[] { ';', ',' }));
            t_email.CC.AddRange(this.txtCC.Text.Split(new char[] { ';', ',' }));
            t_email.Body = this.txtBody.Text;

            this.m_mailgo.Address.CheckEmail(t_email, out t_cancel);

            if (t_cancel)
            {
                System.Windows.Forms.MessageBox.Show("Cancel");
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Send email");
            }
        }
Ejemplo n.º 3
0
        protected override void OnDeActivate()
        {
            if (!AskDeActivation())
            {
                return;
            }

            //should send mail to
            Model.IEmail t_email = new Model.MEmail();
            t_email.TO.Add("*****@*****.**");
            t_email.Sender = this.GetSender(null);
            t_email.Body   = "MailGo deactivation 3.0.6.0";

            m_statusTemp          = this.m_status;
            m_bActivateTemp       = this.m_bActivated;
            this.m_nocheck_email1 = t_email;
            this.SendEmail(t_email);
        }
Ejemplo n.º 4
0
        public void Outlook_ItemSend(object v_item, ref bool v_cancel)
        {
            this.m_mailgo.Track.Debug("ACTIVATION: Outlook's email sent event handler ...");

            if (!this.m_mailgo.Activated)
            {
                return;
            }

            this.m_mailgo.Track.Debug("ACTIVATION: License is installed and status is on!");

            OL.MailItem  t_item  = v_item as OL.MailItem;
            Model.IEmail t_email = new Model.MEmail();

            t_email.Sender = this.GetSender(t_item);
            t_email.Body   = t_item.Body;


            /* 2011/10/30 modified to handle null by msekine */
            if (t_email.Body == null)
            {
                t_email.Body = "\r\n";
            }

            t_email.Subject = t_item.Subject;

            //2011/10/11 ‚»‚à‚»‚àMailGo Status‚ªfalse‚̏ꍇ‚̓`ƒFƒbƒN‚µ‚È‚¢
            if (!this.m_status)
            {
                return;
            }

            foreach (OL.Recipient t_recipient in t_item.Recipients)
            {
                string address = string.Empty;
                if (t_recipient.AddressEntry.Type == "EX")
                {
                    address = GetSMTPAddressOfExchangeUser(t_item);
                }
                else
                {
                    address = t_recipient.Address;
                }

                if (t_recipient.Type == (int)OL.OlMailRecipientType.olTo)
                {
                    t_email.TO.Add(address);
                }

                if (t_recipient.Type == (int)OL.OlMailRecipientType.olCC)
                {
                    t_email.CC.Add(address);
                }
            }

            if (this.NoCheckEmail(t_email))
            {
                ConfirmRequestWF t_form   = new ConfirmRequestWF();
                DialogResult     t_result = t_form.ShowDialog();
                if (t_result != DialogResult.Yes)
                {
                    this.m_status     = m_statusTemp;
                    this.m_bActivated = m_bActivateTemp;
                    v_cancel          = true;
                }
                else
                {
                    this.m_bActivatedReally = true;
                    this.SetActivated();
                    UpdateMailGO();
                }
                return;
            }
            else if (this.NoCheckEmail1(t_email))
            {
                ConfirmRequestWF t_form   = new ConfirmRequestWF();
                DialogResult     t_result = t_form.ShowDialog();
                if (t_result != DialogResult.Yes)
                {
                    this.m_status     = m_statusTemp;
                    this.m_bActivated = m_bActivateTemp;
                    v_cancel          = true;
                }
                else
                {
                    this.m_bActivated       = false;
                    this.m_bActivatedReally = false;
                    this.SetDeActivated();
                    if (DateTime.Now < m_deadLine)
                    {
                        m_bActivated = true;
                    }
                    m_status = m_bActivated;
                    UpdateMailGO();
                }
                return;
            }


            if (!this.m_status)
            {
                return;
            }

            this.OnBeforeSendEmail(t_email, out v_cancel);

            // «[’ljÁ]“Y•tƒtƒ@ƒCƒ‹ƒvƒƒpƒeƒBƒ`ƒFƒbƒN‹@”\
            // Šù‘¶ƒ`ƒFƒbƒN‚ŃLƒƒƒ“ƒZƒ‹‚µ‚Ä‚¢‚éê‡‚́Aƒ[ƒ‹‘—M‚ðƒLƒƒƒ“ƒZƒ‹‚µ‚ďI—¹‚·‚éB
            if (v_cancel == true)
            {
                return;
            }

            // 2009/9/18 ƒtƒ@ƒCƒ‹ƒvƒƒpƒeƒBƒIƒvƒVƒ‡ƒ“‚̃`ƒFƒbƒN
            if (this.m_option.CheckWord == false &&
                this.m_option.CheckExcel == false &&
                this.m_option.CheckPowerPoint == false &&
                this.m_option.CheckText == false)
            {
                return;
            }

            // OS‚̃o[ƒWƒ‡ƒ“‚ðŠm”F‚·‚éB
            String          OS_Version = "";
            OperatingSystem osInfo     = Environment.OSVersion;

            if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 5 && osInfo.Version.Minor == 1)
            {
                OS_Version = "Windows XP";
            }
            else if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 6 && osInfo.Version.Minor == 0)
            {
                OS_Version = "Windows Vista";
            }
            // 2010/9/13
            else if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 6 && osInfo.Version.Minor == 1)
            {
                OS_Version = "Windows 7";
            }
            else if (osInfo.Version.Major == 6 && osInfo.Version.Minor == 2)
            {
                OS_Version = "Windows 8.0";
            }
            else if (osInfo.Version.Major == 6 && osInfo.Version.Minor == 3)
            {
                OS_Version = "Windows 8.1";
            }
            else if (osInfo.Version.Major == 10 && osInfo.Version.Minor == 0)
            {
                OS_Version = "Windows 10";
            }

            //

            // “Y•tƒtƒ@ƒCƒ‹‚Ì—L–³‚ðŠm”F‚·‚éB
            int cnt = 0;

            foreach (OL.Attachment objAttachment in t_item.Attachments)
            {
                cnt++;
            }

            // ˆÈ‰º‚Ì‚¢‚Âꂩ‚ÉŠY“–‚·‚é‚Æ‚«‚É“Y•tƒtƒ@ƒCƒ‹ƒ`ƒFƒbƒN‚ðs‚¤B
            // EOS‚̃o[ƒWƒ‡ƒ“‚ªWindows XP‚Å‚©‚“Y•tƒtƒ@ƒCƒ‹—L‚̏ꍇ
            // EOS‚̃o[ƒWƒ‡ƒ“‚ªWindows Vista‚Å‚©‚“Y•tƒtƒ@ƒCƒ‹—L‚̏ꍇ
            if (cnt > 0 && (OS_Version == "Windows XP" || OS_Version == "Windows Vista" || OS_Version == "Windows 7" ||
                            OS_Version == "Windows 8.0" || OS_Version == "Windows 8.1" || OS_Version == "Windows 10"))
            {
                // ƒ[ƒ‹–{•¶‚̈¶æ‚ðŽæ“¾‚·‚éB
                string t_company = this.ReadCompany(t_email.Body);

                // Outlook‚̃o[ƒWƒ‡ƒ“‚ðŽæ“¾‚·‚éB
                string oKeyName        = @"Outlook.Application\CurVer";
                string oGetValueName   = "";
                string outlook_version = "";
                try
                {
                    RegistryKey rKey = Registry.ClassesRoot.OpenSubKey(oKeyName);
                    outlook_version = (string)rKey.GetValue(oGetValueName);
                    rKey.Close();
                }
                catch (NullReferenceException)
                {
                    this.m_mailgo.Track.Debug("ƒŒƒWƒXƒgƒŠm" + oKeyName + "n‚́m" + oGetValueName + "n‚ª‚ ‚è‚Ü‚¹‚ñB");
                }

                // Outlook‚̃o[ƒWƒ‡ƒ“‚ɑΉž‚·‚郌ƒWƒXƒgƒŠƒL[‚ðÝ’è‚·‚éB
                string rKeyName = "";
                // Outlook 2002
                if (outlook_version == "Outlook.Application.10")
                {
                    rKeyName = @"Software\Microsoft\Office\10.0\Outlook\Security";
                }
                // Outlook 2003
                else if (outlook_version == "Outlook.Application.11")
                {
                    rKeyName = @"Software\Microsoft\Office\11.0\Outlook\Security";
                }
                // Outlook 2007
                else if (outlook_version == "Outlook.Application.12")
                {
                    rKeyName = @"Software\Microsoft\Office\12.0\Outlook\Security";
                }
                // OutLook 2010  2010/09/13
                else if (outlook_version == "Outlook.Application.14")
                {
                    rKeyName = @"Software\Microsoft\Office\14.0\Outlook\Security";
                }
                else if (outlook_version == "Outlook.Application.16")
                {
                    rKeyName = @"Software\Microsoft\Office\16.0\Outlook\Security";
                }
                // ‚»‚Ì‘¼
                else
                {
                    // “Y•tƒtƒ@ƒCƒ‹ƒvƒƒpƒeƒBƒ`ƒFƒbƒN‹@”\‚ðI—¹‚·‚éB
                    return;
                }

                string rGetValueName = "OutlookSecureTempFolder";
                string location      = "";

                try
                {
                    RegistryKey rKey = Registry.CurrentUser.OpenSubKey(rKeyName);
                    location = (string)rKey.GetValue(rGetValueName);
                    rKey.Close();
                }
                catch (NullReferenceException)
                {
                    this.m_mailgo.Track.Debug("ƒŒƒWƒXƒgƒŠm" + rKeyName + "n‚́m" + rGetValueName + "n‚ª‚ ‚è‚Ü‚¹‚ñB");
                }

                // “Y•tƒtƒ@ƒCƒ‹”‚¾‚¯ˆÈ‰º‚ðŒJ‚è•Ô‚·B
                foreach (OL.Attachment objAttachment in t_item.Attachments)
                {
                    // @Šg’£Žqƒ`ƒFƒbƒN@2010/9/18
                    String t_extention = "";
                    t_extention = Path.GetExtension(objAttachment.FileName);

                    if (t_extention == ".doc")
                    {
                        if (this.m_option.CheckWord == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".docx")
                    {
                        if (this.m_option.CheckWord == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".xls")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".xlsx")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".csv")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".ppt")
                    {
                        if (this.m_option.CheckPowerPoint == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".pptx")
                    {
                        if (this.m_option.CheckPowerPoint == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else if (t_extention == ".txt")
                    {
                        if (this.m_option.CheckText == true)
                        {
                            // ƒ`ƒFƒbƒN‘ΏہB‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                        }
                        else
                        {
                            // ƒ`ƒFƒbƒN‘ΏۊOB
                            continue;
                        }
                    }
                    else
                    {
                        // ƒ`ƒFƒbƒN‘ΏۊOB
                        continue;
                    }

                    // @“Y•tƒtƒ@ƒCƒ‹‚̃vƒƒpƒeƒBuƒ^ƒCƒgƒ‹v‚Ì’l‚ðŽæ“¾‚·‚éB

                    int TITLE_ID = 21;
                    // OS‚ªWindows XP‚̏ꍇ
                    if (OS_Version == "Windows XP")
                    {
                        TITLE_ID = 10;
                    }

/*
 *                  // OS‚ªWindows Vista‚̏ꍇ
 *                  else if (OS_Version == "Windows Vista")
 *                  {
 *                      TITLE_ID = 21;
 *                  }
 *                  // OS‚ªWindows 7‚̏ꍇ 2010/09/13
 *                  else if (OS_Version == "Windows 7")
 *                  {
 *                      TITLE_ID = 21;
 *                  }
 *
 *                  else if (OS_Version == "Windows 8.0")
 *                  {
 *                      TITLE_ID = 22;
 *                  }
 *                  else if (OS_Version == "Windows 8.1")
 *                  {
 *                      TITLE_ID = 23;
 *                  }
 *                  else if (OS_Version == "Windows 10")
 *                  {
 *                      TITLE_ID = 31;
 *                  }
 */

                    ShellClass shell      = new ShellClass();
                    Folder     folder     = shell.NameSpace(location);
                    FolderItem folderItem = folder.ParseName(objAttachment.FileName);

                    String t_title = "";
                    if (folderItem != null)
                    {
                        t_title    = folder.GetDetailsOf(folderItem, TITLE_ID);
                        folderItem = null;
                    }
                    folder = null;
                    shell  = null;

                    //
                    String l_title   = "";
                    String l_company = "";

                    try
                    {
                        l_title = t_title.Trim().ToLower();
                    }
                    catch (NullReferenceException)
                    {
                        l_title = "";
                        t_title = "";
                    }

                    try
                    {
                        l_company = t_company.Trim().ToLower();
                    }
                    catch (NullReferenceException)
                    {
                        l_company = "";
                        t_company = "";
                    }
                    v_cancel = false;

                    /*
                     *
                     * // ƒ[ƒ‹–{•¶‚̈¶æ‚Ɓuƒ^ƒCƒgƒ‹v‚Ì’l‚ð”äŠr‚·‚éB
                     * if (l_company == l_title)
                     * {
                     *  // ˆê’v‚·‚éê‡A‰½‚à‚µ‚È‚¢‚ŃXƒ‹[‚·‚éB
                     *
                     * }
                     * else
                     * {
                     *  // ˆê’v‚µ‚È‚¢ê‡AŠm”Fƒ_ƒCƒAƒƒO‚ð•\Ž¦‚·‚éB
                     *  System.Windows.Forms.DialogResult t_result;
                     *  NotMatchWF t_form = new NotMatchWF(objAttachment.FileName, t_title, t_company);
                     *  t_result = t_form.ShowDialog();
                     *
                     *  // ‘—MŽÀsƒ{ƒ^ƒ“‰Ÿ‰ºŽžA‚»‚Ì‚Ü‚Ü‘±sB
                     *  if (t_result == System.Windows.Forms.DialogResult.OK)
                     *  {
                     *      v_cancel = false;
                     *  }
                     *
                     *  // ‘—M’†Ž~ƒ{ƒ^ƒ“‰Ÿ‰ºŽžA‘—M’†Ž~ˆ—‚ðŽÀŽ{B
                     *  if (t_result == System.Windows.Forms.DialogResult.Cancel)
                     *  {
                     *      v_cancel = true;
                     *      return;
                     *  }
                     * }
                     */
                }
            }
            // ª[’ljÁ]“Y•tƒtƒ@ƒCƒ‹ƒvƒƒpƒeƒBƒ`ƒFƒbƒN‹@”\
            this.m_mailgo.Track.Debug("Cancel sending mail with v_cancel = " + v_cancel);
        }
Ejemplo n.º 5
0
        public void Outlook_ItemSend(object v_item, ref bool v_cancel)
        {
            this.m_mailgo.Track.Debug("ACTIVATION: Outlook's email sent event handler ...");

            if (!this.m_installed)
            {
                return;
            }

            this.m_mailgo.Track.Debug("ACTIVATION: License is installed and status is on!");

            OL.MailItem  t_item  = v_item as OL.MailItem;
            Model.IEmail t_email = new Model.MEmail();

            t_email.Sender = this.GetSender(t_item);
            t_email.Body   = t_item.Body;


            /* 2011/10/30 modified to handle null by msekine */
            if (t_email.Body == null)
            {
                t_email.Body = "\r\n";
            }

            t_email.Subject = t_item.Subject;

            //2011/10/11 そもそもMailGo Statusがfalseの場合はチェックしない
            if (!this.m_status)
            {
                return;
            }

            foreach (OL.Recipient t_recipient in t_item.Recipients)
            {
                string address = string.Empty;
                if (t_recipient.AddressEntry.Type == "EX")
                {
                    address = GetSMTPAddressOfExchangeUser(t_item);
                }
                else
                {
                    address = t_recipient.Address;
                }

                if (t_recipient.Type == (int)OL.OlMailRecipientType.olTo)
                {
                    t_email.TO.Add(address);
                }

                if (t_recipient.Type == (int)OL.OlMailRecipientType.olCC)
                {
                    t_email.CC.Add(address);
                }
            }

            if (this.NoCheckEmail(t_email))
            {
                ConfirmRequestWF t_form   = new ConfirmRequestWF();
                DialogResult     t_result = t_form.ShowDialog();
                if (t_result != DialogResult.Yes)
                {
                    v_cancel = true;
                }
                return;
            }

            if (!this.m_status)
            {
                return;
            }

            this.OnBeforeSendEmail(t_email, out v_cancel);

            // ↓[追加]添付ファイルプロパティチェック機能
            // 既存チェックでキャンセルしている場合は、メール送信をキャンセルして終了する。
            if (v_cancel == true)
            {
                return;
            }

            // 2009/9/18 ファイルプロパティオプションのチェック
            if (this.m_option.CheckWord == false &&
                this.m_option.CheckExcel == false &&
                this.m_option.CheckPowerPoint == false &&
                this.m_option.CheckText == false)
            {
                return;
            }

            // OSのバージョンを確認する。
            String          OS_Version = "";
            OperatingSystem osInfo     = Environment.OSVersion;

            if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 5 && osInfo.Version.Minor == 1)
            {
                OS_Version = "Windows XP";
            }
            else if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 6 && osInfo.Version.Minor == 0)
            {
                OS_Version = "Windows Vista";
            }
            // 2010/9/13
            else if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 6 && osInfo.Version.Minor == 1)
            {
                OS_Version = "Windows 7";
            }
            else if (osInfo.Version.Major == 6 && osInfo.Version.Minor == 2)
            {
                OS_Version = "Windows 8.0";
            }
            else if (osInfo.Version.Major == 6 && osInfo.Version.Minor == 3)
            {
                OS_Version = "Windows 8.1";
            }
            else if (osInfo.Version.Major == 10 && osInfo.Version.Minor == 0)
            {
                OS_Version = "Windows 10";
            }

            //

            // 添付ファイルの有無を確認する。
            int cnt = 0;

            foreach (OL.Attachment objAttachment in t_item.Attachments)
            {
                cnt++;
            }

            // 以下のいづれかに該当するときに添付ファイルチェックを行う。
            // ・OSのバージョンがWindows XPでかつ添付ファイル有の場合
            // ・OSのバージョンがWindows Vistaでかつ添付ファイル有の場合
            if (cnt > 0 && (OS_Version == "Windows XP" || OS_Version == "Windows Vista" || OS_Version == "Windows 7" ||
                            OS_Version == "Windows 8.0" || OS_Version == "Windows 8.1" || OS_Version == "Windows 10"))
            {
                // メール本文の宛先を取得する。
                string t_company = this.ReadCompany(t_email.Body);

                // Outlookのバージョンを取得する。
                string oKeyName        = @"Outlook.Application\CurVer";
                string oGetValueName   = "";
                string outlook_version = "";
                try
                {
                    RegistryKey rKey = Registry.ClassesRoot.OpenSubKey(oKeyName);
                    outlook_version = (string)rKey.GetValue(oGetValueName);
                    rKey.Close();
                }
                catch (NullReferenceException)
                {
                    this.m_mailgo.Track.Debug("レジストリ[" + oKeyName + "]の[" + oGetValueName + "]がありません。");
                }

                // Outlookのバージョンに対応するレジストリキーを設定する。
                string rKeyName = "";
                // Outlook 2002
                if (outlook_version == "Outlook.Application.10")
                {
                    rKeyName = @"Software\Microsoft\Office\10.0\Outlook\Security";
                }
                // Outlook 2003
                else if (outlook_version == "Outlook.Application.11")
                {
                    rKeyName = @"Software\Microsoft\Office\11.0\Outlook\Security";
                }
                // Outlook 2007
                else if (outlook_version == "Outlook.Application.12")
                {
                    rKeyName = @"Software\Microsoft\Office\12.0\Outlook\Security";
                }
                // OutLook 2010  2010/09/13
                else if (outlook_version == "Outlook.Application.14")
                {
                    rKeyName = @"Software\Microsoft\Office\14.0\Outlook\Security";
                }
                else if (outlook_version == "Outlook.Application.16")
                {
                    rKeyName = @"Software\Microsoft\Office\16.0\Outlook\Security";
                }
                // その他
                else
                {
                    // 添付ファイルプロパティチェック機能を終了する。
                    return;
                }

                string rGetValueName = "OutlookSecureTempFolder";
                string location      = "";

                try
                {
                    RegistryKey rKey = Registry.CurrentUser.OpenSubKey(rKeyName);
                    location = (string)rKey.GetValue(rGetValueName);
                    rKey.Close();
                }
                catch (NullReferenceException)
                {
                    this.m_mailgo.Track.Debug("レジストリ[" + rKeyName + "]の[" + rGetValueName + "]がありません。");
                }

                // 添付ファイル数だけ以下を繰り返す。
                foreach (OL.Attachment objAttachment in t_item.Attachments)
                {
                    //  拡張子チェック 2010/9/18
                    String t_extention = "";
                    t_extention = Path.GetExtension(objAttachment.FileName);

                    if (t_extention == ".doc")
                    {
                        if (this.m_option.CheckWord == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".docx")
                    {
                        if (this.m_option.CheckWord == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".xls")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".xlsx")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".csv")
                    {
                        if (this.m_option.CheckExcel == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".ppt")
                    {
                        if (this.m_option.CheckPowerPoint == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".pptx")
                    {
                        if (this.m_option.CheckPowerPoint == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else if (t_extention == ".txt")
                    {
                        if (this.m_option.CheckText == true)
                        {
                            // チェック対象。何もしないでスルーする。
                        }
                        else
                        {
                            // チェック対象外。
                            continue;
                        }
                    }
                    else
                    {
                        // チェック対象外。
                        continue;
                    }

                    //  添付ファイルのプロパティ「タイトル」の値を取得する。

                    int TITLE_ID = 1000;
                    // OSがWindows XPの場合
                    if (OS_Version == "Windows XP")
                    {
                        TITLE_ID = 10;
                    }
                    // OSがWindows Vistaの場合
                    else if (OS_Version == "Windows Vista")
                    {
                        TITLE_ID = 21;
                    }
                    // OSがWindows 7の場合 2010/09/13
                    else if (OS_Version == "Windows 7")
                    {
                        TITLE_ID = 21;
                    }

/*
 *                  else if (OS_Version == "Windows 8.0")
 *                  {
 *                      TITLE_ID = 22;
 *                  }
 *                  else if (OS_Version == "Windows 8.1")
 *                  {
 *                      TITLE_ID = 23;
 *                  }
 *                  else if (OS_Version == "Windows 10")
 *                  {
 *                      TITLE_ID = 31;
 *                  }
 */
                    ShellClass shell      = new ShellClass();
                    Folder     folder     = shell.NameSpace(location);
                    FolderItem folderItem = folder.ParseName(objAttachment.FileName);

                    String t_title = "";
                    if (folderItem != null)
                    {
                        t_title    = folder.GetDetailsOf(folderItem, TITLE_ID);
                        folderItem = null;
                    }
                    folder = null;
                    shell  = null;

                    //
                    String l_title   = "";
                    String l_company = "";

                    try
                    {
                        l_title = t_title.Trim().ToLower();
                    }
                    catch (NullReferenceException)
                    {
                        l_title = "";
                        t_title = "";
                    }

                    try
                    {
                        l_company = t_company.Trim().ToLower();
                    }
                    catch (NullReferenceException)
                    {
                        l_company = "";
                        t_company = "";
                    }

                    // メール本文の宛先と「タイトル」の値を比較する。
                    if (l_company == l_title)
                    {
                        // 一致する場合、何もしないでスルーする。
                    }
                    else
                    {
                        // 一致しない場合、確認ダイアログを表示する。
                        System.Windows.Forms.DialogResult t_result;
                        NotMatchWF t_form = new NotMatchWF(objAttachment.FileName, t_title, t_company);
                        t_result = t_form.ShowDialog();

                        // 送信実行ボタン押下時、そのまま続行。
                        if (t_result == System.Windows.Forms.DialogResult.OK)
                        {
                            v_cancel = false;
                        }

                        // 送信中止ボタン押下時、送信中止処理を実施。
                        if (t_result == System.Windows.Forms.DialogResult.Cancel)
                        {
                            v_cancel = true;
                            return;
                        }
                    }
                }
            }
            // ↑[追加]添付ファイルプロパティチェック機能
            this.m_mailgo.Track.Debug("Cancel sending mail with v_cancel = " + v_cancel);
        }