/// <summary> /// Set a path to report minidump /// </summary> /// <param name="minidumpPath">Path to generated minidump file</param> internal void SetMinidumpPath(string minidumpPath) { if (string.IsNullOrEmpty(minidumpPath)) { return; } MinidumpFile = minidumpPath; AttachmentPaths.Add(minidumpPath); }
public Requests.EmailSend ToObject() { return(new Requests.EmailSend { Account = Account, AttachmentPaths = AttachmentPaths?.Split(','), EmailCC = EmailCC?.Split(','), EmailFrom = EmailFrom, EmailTo = EmailTo?.Split(','), Message = Message, Mime = Mime, Subject = Subject }); }
public void Send(List <string> toList, List <string> ccList) { MailMessage message = new MailMessage(); message.From = new MailAddress(From); foreach (string str in toList) { string str2 = this.ReplaceString(str); if (!string.IsNullOrEmpty(str2) && !message.To.Contains(new MailAddress(str2))) { message.To.Add(str2); } } if (!string.IsNullOrEmpty(From) || !string.IsNullOrEmpty(ReplyTo)) { message.ReplyToList.Add(ReplyTo); } foreach (string str3 in ccList) { string str2 = this.ReplaceString(str3); if (!string.IsNullOrEmpty(str2) && !message.CC.Contains(new MailAddress(str2))) { message.CC.Add(this.Conver2MailAddress(str2)); } } if (!string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["MailBcc"]) && MailTest) { List <string> bccList = ConfigurationManager.AppSettings["MailBcc"].Split(';').ToList(); foreach (string str4 in bccList) { string str2 = this.ReplaceString(str4); if (!string.IsNullOrEmpty(str2) && !message.Bcc.Contains(new MailAddress(str2))) { message.Bcc.Add(this.Conver2MailAddress(str2)); } } } message.IsBodyHtml = true; message.Subject = Subject; message.Body = Body; if (!String.IsNullOrWhiteSpace(AttachmentPath)) { message.Attachments.Add(new Attachment(AttachmentPath)); } if (AttachmentPaths != null && AttachmentPaths.Count() > 0) { foreach (string attachment in AttachmentPaths) { message.Attachments.Add(new Attachment(attachment)); } } if (this.MailToLog) { Log.Info(string.Format("\r\n TO:{0} \r\n CC:{1} \r\n Subject:{2}\r\n Body:{3} \r\n", message.To, message.CC, message.Subject, message.Body)); } else if (!string.IsNullOrEmpty(this.client.Host)) { this.client.Send(message); } }