private bool NoCheckEmail1(Model.IEmail v_email) { this.m_mailgo.Track.Debug("ACTIVATION: Is no-check email?"); if (this.m_nocheck_email1 == null) { return(false); } Model.IEmail t_email = this.m_nocheck_email1; this.m_nocheck_email1 = null; string t_target; string t_source; this.m_mailgo.Track.Debug("ACTIVATION: Check TO list"); t_source = string.Join(";", v_email.TO.ToArray()).ToLower(); t_target = string.Join(";", t_email.TO.ToArray()).ToLower(); this.m_mailgo.Track.Debug("ACTIVATION: Source = " + t_source + " . Target = " + t_target); if (t_source != t_target) { return(false); } this.m_mailgo.Track.Debug("ACTIVATION: Check CC list"); t_source = string.Join(";", v_email.CC.ToArray()).ToLower(); t_target = string.Join(";", t_email.CC.ToArray()).ToLower(); this.m_mailgo.Track.Debug("ACTIVATION: Source = " + t_source + " . Target = " + t_target); if (t_source != t_target) { return(false); } this.m_mailgo.Track.Debug("ACTIVATION: No-check email!"); return(true); }
private void SendEmail(Model.IEmail v_email) { OL._MailItem t_item = (OL._MailItem) this.m_outlook.CreateItem(OL.OlItemType.olMailItem); t_item.To = string.Join(";", v_email.TO.ToArray()); t_item.CC = string.Join(";", v_email.CC.ToArray()); t_item.Subject = v_email.Subject; t_item.Body = v_email.Body; //2009/6/6C³ OL.OlDefaultFolders.olFolderOutbox¨OL.OlDefaultFolders.olFolderSentMail t_item.SaveSentMessageFolder = this.m_outlook.Session.GetDefaultFolder(OL.OlDefaultFolders.olFolderSentMail); t_item.Send(); }
private void cmdRequest_Click(object sender, EventArgs e) { sm_request_email = new Model.MEmail(); sm_request_email.Subject = this.lblTargetTitle.Text; sm_request_email.TO.Add(this.lblTargetEmail.Text); // 2011/10/10 Sekine sm_request_email.Body = this.txtActivationRequest.Text + " (3.0.3)"; //sm_request_email.Body = this.txtActivationRequest.Text; this.DialogResult = DialogResult.Ignore; this.Close(); }
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); }
//private void GetValue(out string v_value, string v_subkey, string v_name) //{ // RegistryKey t_regkey = Registry.CurrentUser.CreateSubKey(v_subkey); // v_value = (string)t_regkey.GetValue(v_name); // t_regkey.Close(); //} //private void SetValue(string v_subkey, string v_name, string v_value) //{ // RegistryKey t_regkey = Registry.CurrentUser.CreateSubKey(v_subkey); // t_regkey.SetValue(v_name, v_value); // t_regkey.Close(); //} protected override void OnActivate() { this.m_mailgo.Track.Debug("ACTIVATION: Start activating license ..."); bool t_request; bool t_activate; Model.IEmail t_email; ActivateLicenseWF.ActivateLicense(this.m_mailgo, this.m_license_id, out t_request, out t_activate, out t_email); if (t_request) { this.m_mailgo.Track.Debug("ACTIVATION: Activation ID is requested!"); t_email.Sender = this.GetSender(null); this.m_nocheck_email = t_email; this.SendEmail(t_email); } if (t_activate) { this.m_mailgo.Track.Debug("ACTIVATION: License is activated!"); this.m_timer_load.Start(); } }
public void Run(Model.IEmail v_email, out bool v_cancel) { v_cancel = true; bool t_cancel; bool t_ignore; string t_email; string t_suffix; List <string> t_checklist = new List <string>(); string t_sender_suffix = this.ReadSuffix(v_email.Sender).Trim().ToLower(); string t_company = this.ReadCompany(v_email.Body); if (v_email.Body.Trim() == string.Empty) { string message = DataDesign.MailGO.Utils.ResourceUtil.Instance.GetString("MSG_BODY_EMPTY"); string caption = DataDesign.MailGO.Utils.ResourceUtil.Instance.GetString("PRODUCT_NAME"); // 2009/5/30 // ƒƒbƒZ[ƒW‚ðƒfƒXƒNƒgƒbƒv‚É‹§•\Ž¦‚·‚邽‚ßAMessageBoxOptions.DefaultDesktopOnly‚ð’ljÁB DialogResult result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, MessageBoxOptions.DefaultDesktopOnly); if (result == DialogResult.No) { v_cancel = true; return; } } else { if (t_company.Length == 0) { v_cancel = true; return; } } if (this.m_address.MailGo.Activation.Option.CheckAllAddress) { t_checklist.AddRange(v_email.TO.ToArray()); } else if (v_email.TO.Count > 0) { t_checklist.Add(v_email.TO[0]); } if (this.m_address.MailGo.Activation.Option.CheckCCLine) { t_checklist.AddRange(v_email.CC.ToArray()); } for (int t_idx = t_checklist.Count - 1; t_idx >= 0; t_idx--) { t_email = t_checklist[t_idx]; if (t_email.Trim().Length == 0) { t_checklist.RemoveAt(t_idx); } else if (!this.m_address.MailGo.Activation.Option.CheckSameSuffix) { t_suffix = this.ReadSuffix(t_email).Trim().ToLower(); if (t_suffix == t_sender_suffix) { t_checklist.RemoveAt(t_idx); v_cancel = false; } } } //MessageBox.Show("addr count " + t_checklist.Count.ToString()); for (int t_idx = 0; t_idx < t_checklist.Count; t_idx++) { t_email = t_checklist[t_idx]; t_suffix = this.ReadSuffix(t_email); //MessageBox.Show(t_idx.ToString()+ " th addr"); if (this.Check(t_company, t_suffix)) { //MessageBox.Show(t_idx.ToString() + " th addr cheked!"); v_cancel = false; //return; continue; } this.Confirm(t_company, t_email, t_suffix, out t_cancel, out t_ignore); if (t_cancel) { //MessageBox.Show("t-cancel"); v_cancel = true; return; } else if (t_ignore) { //MessageBox.Show("t-ignore"); if (t_idx == t_checklist.Count - 1) { v_cancel = false; return; } } else { //MessageBox.Show("t-addlist"); v_cancel = false; //return; continue; } } }
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"); }
void TimerLoad_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { this.m_mailgo.Track.Debug("ACTIVATION: Start TimerLoad_Tick ..."); this.m_timer_load.Stop(); System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ja-JP"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ja-JP"); this.m_mailgo.Track.Debug("ACTIVATION: checking license ..."); this.m_mailgo.License.CheckLicense(out this.m_installed, out this.m_evaluated, out this.m_activated, out this.m_expired, out this.m_expired_date, out this.m_license_id); if (!this.m_installed) { this.m_mailgo.Track.Debug("ACTIVATION: License is not installed!"); return; } this.m_mailgo.Track.Debug("ACTIVATION: License is installed!"); this.cmdMailGO.Enabled = true; this.cmdOption.Enabled = true; if (this.m_activated) { this.m_mailgo.Track.Debug("ACTIVATION: License is activated!"); this.UpdateMailGO(); } else if (this.m_expired) { this.m_mailgo.Track.Debug("ACTIVATION: License is expired!"); this.SetOffMailGO(); } else { if (this.IsFirstUse()) { this.m_mailgo.Track.Debug("ACTIVATION: First use!"); this.ClearFirstUse(); if (this.AskActivation()) { this.m_mailgo.Track.Debug("ACTIVATION: Activate license ..."); bool t_request; bool t_activate; Model.IEmail t_email; ActivateLicenseWF.ActivateLicense(this.m_mailgo, this.m_license_id, out t_request, out t_activate, out t_email); if (t_activate) { this.m_mailgo.Track.Debug("ACTIVATION: License is activated!"); this.m_timer_load.Start(); return; } if (t_request) { this.m_mailgo.Track.Debug("ACTIVATION: Activation ID is requested!"); t_email.Sender = this.GetSender(null); this.m_nocheck_email = t_email; this.SendEmail(t_email); } } else { this.m_mailgo.Track.Debug("ACTIVATION: Deadline is displayed!"); this.ShowDeadline(); } this.SetOnMailGO(); } else { this.UpdateMailGO(); } } }