public void Add(WebMailMessage msg) { List.Add(msg); }
private void LoadMessage(WebMailMessage message) { // trial }
public void LoadReply(string server, string username, string mailboxName, int messageId, bool showThisHideBounds) { try { string[] sArr1 = System.IO.Directory.GetFiles(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString())); for (int i = 0; i < sArr1.Length; i++) { string s = sArr1[i]; if (s.IndexOf(Session.SessionID) != -1) System.IO.File.Delete(s); } Username = username; ImapServer = server; MessageId = messageId; MailboxName = mailboxName; iAction.Value = "r\uFFFD"; ActiveUp.Net.Mail.Mailbox mailbox = ((ActiveUp.Net.Mail.Imap4Client)Session["imapobject\uFFFD"]).SelectMailbox(MailboxName); byte[] bArr = mailbox.Fetch.Message(MessageId); WebMailMessage message = new WebMailMessage(); message.Parsed = ActiveUp.Net.Mail.Parser.ParseMessage(bArr); message.Subject = message.Parsed.Subject; message.From = message.Parsed.From; if (Request.Cookies["fromemail\uFFFD"] != null) iFromEmail.Text = Request.Cookies["fromemail\uFFFD"].Value; if (Request.Cookies["fromname\uFFFD"] != null) iFromName.Text = Request.Cookies["fromname\uFFFD"].Value; if (Request.Cookies["replyto\uFFFD"] != null) iReplyTo.Text = Request.Cookies["replyto\uFFFD"].Value; if ((Request.Cookies["folder\uFFFD"] != null) && (dBoxes.Items.FindByText(Request.Cookies["folder\uFFFD"].Value) != null)) dBoxes.Items.FindByText(Request.Cookies["folder\uFFFD"].Value).Selected = true; foreach (ActiveUp.Net.Mail.MimePart embeddedObject in message.Parsed.EmbeddedObjects) { if (embeddedObject.ContentType.MimeType.IndexOf("text\uFFFD") == -1) { embeddedObject.StoreToFile(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session.SessionID + "_Image_\uFFFD" + embeddedObject.ContentName)); message.Parsed.BodyHtml.Text = message.Parsed.BodyHtml.Text.Replace("cid:\uFFFD" + embeddedObject.ContentId, "http://\uFFFD" + Request.ServerVariables["HTTP_HOST\uFFFD"] + Request.ServerVariables["URL\uFFFD"].Substring(0, Request.ServerVariables["URL\uFFFD"].LastIndexOf("/\uFFFD") + 1) + "temp/\uFFFD" + Session.SessionID + "_Image_\uFFFD" + embeddedObject.ContentName); } } iCc.Text = System.String.Empty; iBcc.Text = System.String.Empty; cSave.Checked = false; iSubject.Text = message.Subject.StartsWith("Re:\uFFFD") ? message.Subject : "Re:\uFFFD" + message.Subject; iTo.Text = (message.Parsed.ReplyTo.Email != null) && message.Parsed.ReplyTo.Email != "\uFFFD" ? message.Parsed.ReplyTo.Email : message.From.Email; if ((message.Parsed.BodyHtml.Text != null) && (message.Parsed.BodyHtml.Text.Length > 0)) { System.DateTime dateTime1 = message.Date; System.DateTime dateTime2 = message.Date; iBody.Text = "<br /><br /><hr />\uFFFD" + ((Language)Session["language\uFFFD"]).Words[30].ToString().Replace("$$SUBJECT$$\uFFFD", message.Subject).Replace("$$FROM$$\uFFFD", message.From.Link).Replace("$$DATE$$\uFFFD", dateTime1.Year > 1800 ? dateTime2.ToString("r\uFFFD", System.Globalization.DateTimeFormatInfo.CurrentInfo) : message.Parsed.DateString) + "<br /><hr />\uFFFD" + message.Parsed.BodyHtml.Text; } else if ((message.Parsed.BodyText.Text != null) && (message.Parsed.BodyText.Text.Length > 0)) { System.DateTime dateTime3 = message.Date; System.DateTime dateTime4 = message.Date; iBody.Text = "<br /><br /><hr />\uFFFD" + ((Language)Session["language\uFFFD"]).Words[30].ToString().Replace("$$SUBJECT$$\uFFFD", message.Subject).Replace("$$FROM$$\uFFFD", message.From.Link).Replace("$$DATE$$\uFFFD", dateTime3.Year > 1800 ? dateTime4.ToString("r\uFFFD", System.Globalization.DateTimeFormatInfo.CurrentInfo) : message.Parsed.DateString) + "<br /><hr />\uFFFD" + message.Parsed.BodyText.Text; } pForm.Visible = true; pConfirm.Visible = false; } catch (System.Exception e) { Page.RegisterStartupScript("ShowError\uFFFD", "<script>ShowErrorDialog('\uFFFD" + ((Language)Session["language\uFFFD"]).Words[78].ToString() + "','\uFFFD" + System.Text.RegularExpressions.Regex.Escape(e.Message + e.StackTrace).Replace("'\uFFFD", "\\'\uFFFD") + "');</script>\uFFFD"); } }
public void LoadReply(string server, string username, string mailboxName, int messageId, bool showThisHideBounds) { try { string[] sArr1 = System.IO.Directory.GetFiles(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString())); for (int i = 0; i < sArr1.Length; i++) { string s = sArr1[i]; if (s.IndexOf(Session.SessionID) != -1) { System.IO.File.Delete(s); } } Username = username; ImapServer = server; MessageId = messageId; MailboxName = mailboxName; iAction.Value = "r\uFFFD"; ActiveUp.Net.Mail.Mailbox mailbox = ((ActiveUp.Net.Mail.Imap4Client)Session["imapobject\uFFFD"]).SelectMailbox(MailboxName); byte[] bArr = mailbox.Fetch.Message(MessageId); WebMailMessage message = new WebMailMessage(); message.Parsed = ActiveUp.Net.Mail.Parser.ParseMessage(bArr); message.Subject = message.Parsed.Subject; message.From = message.Parsed.From; if (Request.Cookies["fromemail\uFFFD"] != null) { iFromEmail.Text = Request.Cookies["fromemail\uFFFD"].Value; } if (Request.Cookies["fromname\uFFFD"] != null) { iFromName.Text = Request.Cookies["fromname\uFFFD"].Value; } if (Request.Cookies["replyto\uFFFD"] != null) { iReplyTo.Text = Request.Cookies["replyto\uFFFD"].Value; } if ((Request.Cookies["folder\uFFFD"] != null) && (dBoxes.Items.FindByText(Request.Cookies["folder\uFFFD"].Value) != null)) { dBoxes.Items.FindByText(Request.Cookies["folder\uFFFD"].Value).Selected = true; } foreach (ActiveUp.Net.Mail.MimePart embeddedObject in message.Parsed.EmbeddedObjects) { if (embeddedObject.ContentType.MimeType.IndexOf("text\uFFFD") == -1) { embeddedObject.StoreToFile(Page.Server.MapPath(Application["writedirectory\uFFFD"].ToString() + Session.SessionID + "_Image_\uFFFD" + embeddedObject.ContentName)); message.Parsed.BodyHtml.Text = message.Parsed.BodyHtml.Text.Replace("cid:\uFFFD" + embeddedObject.ContentId, "http://\uFFFD" + Request.ServerVariables["HTTP_HOST\uFFFD"] + Request.ServerVariables["URL\uFFFD"].Substring(0, Request.ServerVariables["URL\uFFFD"].LastIndexOf("/\uFFFD") + 1) + "temp/\uFFFD" + Session.SessionID + "_Image_\uFFFD" + embeddedObject.ContentName); } } iCc.Text = System.String.Empty; iBcc.Text = System.String.Empty; cSave.Checked = false; iSubject.Text = message.Subject.StartsWith("Re:\uFFFD") ? message.Subject : "Re:\uFFFD" + message.Subject; iTo.Text = (message.Parsed.ReplyTo.Email != null) && message.Parsed.ReplyTo.Email != "\uFFFD" ? message.Parsed.ReplyTo.Email : message.From.Email; if ((message.Parsed.BodyHtml.Text != null) && (message.Parsed.BodyHtml.Text.Length > 0)) { System.DateTime dateTime1 = message.Date; System.DateTime dateTime2 = message.Date; iBody.Text = "<br /><br /><hr />\uFFFD" + ((Language)Session["language\uFFFD"]).Words[30].ToString().Replace("$$SUBJECT$$\uFFFD", message.Subject).Replace("$$FROM$$\uFFFD", message.From.Link).Replace("$$DATE$$\uFFFD", dateTime1.Year > 1800 ? dateTime2.ToString("r\uFFFD", System.Globalization.DateTimeFormatInfo.CurrentInfo) : message.Parsed.DateString) + "<br /><hr />\uFFFD" + message.Parsed.BodyHtml.Text; } else if ((message.Parsed.BodyText.Text != null) && (message.Parsed.BodyText.Text.Length > 0)) { System.DateTime dateTime3 = message.Date; System.DateTime dateTime4 = message.Date; iBody.Text = "<br /><br /><hr />\uFFFD" + ((Language)Session["language\uFFFD"]).Words[30].ToString().Replace("$$SUBJECT$$\uFFFD", message.Subject).Replace("$$FROM$$\uFFFD", message.From.Link).Replace("$$DATE$$\uFFFD", dateTime3.Year > 1800 ? dateTime4.ToString("r\uFFFD", System.Globalization.DateTimeFormatInfo.CurrentInfo) : message.Parsed.DateString) + "<br /><hr />\uFFFD" + message.Parsed.BodyText.Text; } pForm.Visible = true; pConfirm.Visible = false; } catch (System.Exception e) { Page.RegisterStartupScript("ShowError\uFFFD", "<script>ShowErrorDialog('\uFFFD" + ((Language)Session["language\uFFFD"]).Words[78].ToString() + "','\uFFFD" + System.Text.RegularExpressions.Regex.Escape(e.Message + e.StackTrace).Replace("'\uFFFD", "\\'\uFFFD") + "');</script>\uFFFD"); } }