private void LoadSavedmails() { #region Load saved mails foreach (String item in File.ReadLines(ListOfPath.SavedMailLogs)) { string thePath = Encoding.UTF8.GetString( Convert.FromBase64String(item)); if (Availble.AvailblePath.Contains(thePath)) { continue; } if (File.Exists(thePath)) { SaveMail Savedmail = new SaveMail(); if (Savedmail.Load(thePath) == true) { Availble.AvailblePath.Add(thePath); CallRecord(Savedmail.Sender, Savedmail.Subject, thePath, Savedmail.SenderAvatar); } Savedmail = null; } } if (ListSavedMails.Controls.Count < 1) { ShowEmptySavedMail(); } #endregion }
public Domain(int id_account, string name, IncomingMailProtocol mail_protocol, string mail_inc_host, int mail_inc_port, string mail_out_host, int mail_out_port, bool mail_out_auth) { _id = id_account; _name = name; _mailProtocol = mail_protocol; _mailIncHost = mail_inc_host; _mailIncPort = mail_inc_port; _mailOutHost = mail_out_host; _mailOutPort = mail_out_port; _mailOutAuthentication = mail_out_auth; WebmailSettings settings = (new WebMailSettingsCreator()).CreateWebMailSettings(); _url = string.Empty; _site_name = settings.SiteName; _settings_mail_protocol = settings.IncomingMailProtocol; _settings_mail_inc_host = settings.IncomingMailServer; _settings_mail_inc_port = settings.IncomingMailPort; _settings_mail_out_host = settings.OutgoingMailServer; _settings_mail_out_port = settings.OutgoingMailPort; _settings_mail_out_auth = settings.ReqSmtpAuth; _allow_direct_mode = settings.AllowDirectMode; _direct_mode_id_def = settings.DirectModeIsDefault; _attachment_size_limit = settings.AttachmentSizeLimit; _allow_attachment_limit = settings.EnableAttachmentSizeLimit; _mailbox_size_limit = settings.MailboxSizeLimit; _allow_mailbox_limit = settings.EnableMailboxSizeLimit; _take_quota = settings.TakeImapQuota; _allow_new_users_change_settings = settings.AllowUsersChangeEmailSettings; _allow_auto_reg_on_login = settings.AllowNewUsersRegister; _allow_users_add_accounts = settings.AllowUsersAddNewAccounts; _allow_users_change_account_def = settings.AllowUsersChangeAccountsDef; _def_user_charset = settings.DefaultUserCharset; _allow_users_change_charset = settings.AllowUsersChangeCharset; _def_user_timezone = settings.DefaultTimeZone; _allow_users_change_timezone = settings.AllowUsersChangeTimeZone; _msgs_per_page = settings.MailsPerPage; _skin = settings.DefaultSkin; _allow_users_change_skin = settings.AllowUsersChangeSkin; _lang = settings.DefaultLanguage; _allow_users_change_lang = settings.AllowUsersChangeLanguage; _show_text_labels = settings.ShowTextLabels; _allow_ajax = settings.AllowAjax; _allow_editor = settings.AllowDhtmlEditor; _allow_contacts = settings.AllowContacts; _allow_calendar = settings.AllowCalendar; _hide_login_mode = settings.HideLoginMode; _domain_to_use = settings.DefaultDomainOptional; _allow_choosing_lang = settings.AllowLanguageOnLogin; _allow_advanced_login = settings.AllowAdvancedLogin; _allow_auto_detect_and_correct = settings.AutomaticCorrectLoginSettings; _viewmode = settings.ViewMode; _save_mail = SaveMail.Always; }
private void ShowSavedMail_Load(object sender, EventArgs e) { #region Check Saved mail path is availble or not if (!File.Exists(PathOfSavedMail)) { MessageBox.Show("Sorry! This mail is no longer!", "NOT FOUND!", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Dispose(); return; } #endregion #region LoadInfomation SaveMail Savedmail = new SaveMail(); if (Savedmail.Load(PathOfSavedMail) == true) { Subject.Text = Savedmail.Subject; senderX.Text = SenderMail = "From: " + Savedmail.Sender; SenderAvatar = Savedmail.SenderAvatar; DateTimeShow.Text = Savedmail.DateTimeReceived; if (String.IsNullOrEmpty(Savedmail.Body) || String.IsNullOrWhiteSpace(Savedmail.Body)) { Decrypt.Enabled = false; } else { try { var Temp = Convert.FromBase64String(Savedmail.Body); Decrypt.Enabled = true; } catch (Exception) { Decrypt.Enabled = false; } } ContentShow.DocumentText = Savedmail.Body; } else { MessageBox.Show("Saved Mail is defective!", "CAN NOT READ", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Dispose(); return; } #endregion }
private void LoadSavedmails() { #region Load saved mails foreach (String item in File.ReadLines(ListOfPath.SavedMailLogs)) { string thePath = Encoding.UTF8.GetString( Convert.FromBase64String(item)); if (Availble.AvailblePath.Contains(thePath)) { continue; } if (File.Exists(thePath)) { // For check mail saved life! FileInfo I4 = new FileInfo(thePath); TimeSpan x = DateTime.Now - I4.CreationTime; if (x.Days > Setting.TimeDele) { File.Delete(thePath); continue; } // Another SaveMail Savedmail = new SaveMail(); if (Savedmail.Load(thePath) == true) { Availble.AvailblePath.Add(thePath); CallRecord(Savedmail.Sender, Savedmail.Subject, thePath, Savedmail.SenderAvatar); } Savedmail = null; } } if (ListSavedMails.Controls.Count < 1) { ShowEmptySavedMail(); } #endregion }
public Domain(int id_account, string name, IncomingMailProtocol mail_protocol, string mail_inc_host, int mail_inc_port, string mail_out_host, int mail_out_port, bool mail_out_auth, string url, string site_name, IncomingMailProtocol settings_mail_protocol, string settings_mail_inc_host, int settings_mail_inc_port, string settings_mail_out_host, int settings_mail_out_port, bool settings_mail_out_auth, bool allow_direct_mode, bool direct_mode_id_def, long attachment_size_limit, bool allow_attachment_limit, long mailbox_size_limit, bool allow_mailbox_limit, bool take_quota, bool allow_new_users_change_settings, bool allow_auto_reg_on_login, bool allow_users_add_accounts, bool allow_users_change_account_def, int def_user_charset, bool allow_users_change_charset, int def_user_timezone, bool allow_users_change_timezone, int msgs_per_page, string skin, bool allow_users_change_skin, string lang, bool allow_users_change_lang, bool show_text_labels, bool allow_ajax, bool allow_editor, bool allow_contacts, bool allow_calendar, LoginMode hide_login_mode, string domain_to_use, bool allow_choosing_lang, bool allow_advanced_login, bool allow_auto_detect_and_correct, bool contacts_sharing, ViewMode viewmode, SaveMail save_mail) { _id = id_account; _name = name; _mailProtocol = mail_protocol; _mailIncHost = mail_inc_host; _mailIncPort = mail_inc_port; _mailOutHost = mail_out_host; _mailOutPort = mail_out_port; _mailOutAuthentication = mail_out_auth; _url = url; _site_name = site_name; _settings_mail_protocol = settings_mail_protocol; _settings_mail_inc_host = settings_mail_inc_host; _settings_mail_inc_port = settings_mail_inc_port; _settings_mail_out_host = settings_mail_out_host; _settings_mail_out_port = settings_mail_out_port; _settings_mail_out_auth = settings_mail_out_auth; _allow_direct_mode = allow_direct_mode; _direct_mode_id_def = direct_mode_id_def; _attachment_size_limit = attachment_size_limit; _allow_attachment_limit = allow_attachment_limit; _mailbox_size_limit = mailbox_size_limit; _allow_mailbox_limit = allow_mailbox_limit; _take_quota = take_quota; _allow_new_users_change_settings = allow_new_users_change_settings; _allow_auto_reg_on_login = allow_auto_reg_on_login; _allow_users_add_accounts = allow_users_add_accounts; _allow_users_change_account_def = allow_users_change_account_def; _def_user_charset = def_user_charset; _allow_users_change_charset = allow_users_change_charset; _def_user_timezone = def_user_timezone; _allow_users_change_timezone = allow_users_change_timezone; _msgs_per_page = msgs_per_page; _skin = skin; _allow_users_change_skin = allow_users_change_skin; _lang = lang; _allow_users_change_lang = allow_users_change_lang; _show_text_labels = show_text_labels; _allow_ajax = allow_ajax; _allow_editor = allow_editor; _allow_contacts = allow_contacts; _allow_calendar = allow_calendar; _hide_login_mode = hide_login_mode; _domain_to_use = domain_to_use; _allow_choosing_lang = allow_choosing_lang; _allow_advanced_login = allow_advanced_login; _allow_auto_detect_and_correct = allow_auto_detect_and_correct; _global_addr_book = contacts_sharing; _viewmode = viewmode; _save_mail = save_mail; }