本文整理汇总了C#中Whitfieldcore.InsertEmailConversation方法的典型用法代码示例。如果您正苦于以下问题:C# Whitfieldcore.InsertEmailConversation方法的具体用法?C# Whitfieldcore.InsertEmailConversation怎么用?C# Whitfieldcore.InsertEmailConversation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Whitfieldcore
的用法示例。
在下文中一共展示了Whitfieldcore.InsertEmailConversation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: sendEmail
private void sendEmail(String _estNum, String filenm, String IsFinancial)
{
Whitfieldcore _wcore = new Whitfieldcore();
whitfielduser _wuser = new whitfielduser();
using (DataSet dsContacts = _wcore.GetContactsForProject(Convert.ToInt32(_estNum)))
{
DataTable dtContacts = dsContacts.Tables[0];
if (dtContacts.Rows.Count > 0)
{
foreach (DataRow dRow in dtContacts.Rows)
{
String _contactNm = dRow["contactName"] == DBNull.Value ? " " : dRow["contactName"].ToString();
String _contactEmail = dRow["email"] == DBNull.Value ? " " : dRow["email"].ToString();
String _clientnm = dRow["Name"] == DBNull.Value ? " " : dRow["Name"].ToString();
String _contactNumber = _wuser.GetContactNo(prjEsti);
String mode = "";
if (IsFinancial == "Y")
{
mode = "Proposal";
}
else
{
mode = "Scope";
}
//HHS Uncomment this portion when there is an email list.
MailMessage message = new MailMessage();
//message.To.Add(System.Configuration.ConfigurationManager.AppSettings["devEmail"]);
//message.To.Add(System.Configuration.ConfigurationManager.AppSettings["AdminEmail"].ToString());
message.To.Add(_contactEmail); //This will be added once JW oks the function
message.To.Add(System.Configuration.ConfigurationManager.AppSettings["EstimatingEmail"].ToString()); //This is tested for contact Email, remove once JW oks the function.
message.From = new MailAddress(System.Configuration.ConfigurationManager.AppSettings["EstimatingEmail"]);
message.Subject = txtprjname + " Architectural Millwork - WhitfieldCo - " + mode;
message.IsBodyHtml = true;
StringBuilder sb = new StringBuilder();
sb.Append("<html><head></head>");
sb.Append("<body>");
sb.Append("<TABLE cellSpacing='0' cellPadding='0' width='100%' border='0'><TR>");
sb.Append("<TD>");
sb.Append(_contactNm.Replace(",", " ") + ",<br>");
sb.Append("<br>Thank you for the opportunity to provide pricing on the " + txtprjname + " project for " + _clientnm + ". <br>");
sb.Append("<br>Please find attached our " + mode + " for the Custom Architectural Millwork which includes a complete and comprehensive scope for this work.<br>");
sb.Append("<br>You may contact me at " + _contactNumber + " with any questions regarding this estimate.<br>");
//sb.Append(<br>"_wuser.GetEstimatorName(prjEsti));
sb.Append("<br>" + txtNotes);
sb.Append("<br><br>" + _wuser.GetEstimatorName(prjEsti)+ ",<br>");
sb.Append("Estimator");
sb.Append("<br><br>");
sb.Append("</TD>");
sb.Append("</TR></TABLE>");
//Footer
sb.Append("<TABLE cellSpacing='0' cellPadding='0' width='100%' border='0'><TR>");
sb.Append("<TD><IMG height='80' alt='' src='http://www.whitfield-co.com/whitfield-co/assets/img/TWC%20Primary%20Logo1.JPG' border='0'></TD></TR>");
sb.Append("<TR><TD class='form1' vAlign='bottom' align='left' width='100%'><b>The Whitfield Co., Inc.<br>");
sb.Append("8836 Washington Blvd., Ste 101<br>");
sb.Append("Jessup, MD 20794<br>");
sb.Append("(301)-483-0791<br>");
sb.Append("(301)-483-0792<br>");
sb.Append("http://www.whitfield-co.com<br>");
sb.Append("<IMG height='9' alt='' src='http://www.whitfield-co.com/whitfield-co/assets/img/images.gif' width='1'>");
sb.Append("</TD>");
sb.Append("</TR></TABLE>");
sb.Append("</body></html>");
message.Body = sb.ToString();
message.Attachments.Add(new System.Net.Mail.Attachment(HttpContext.Current.Server.MapPath("~/attachments/") + filenm));
SmtpClient smtp = new SmtpClient(System.Configuration.ConfigurationManager.AppSettings["smtp"]);
smtp.Send(message);
if (!_contactEmail.Equals(""))
{
_wcore.InsertEmailConversation(Convert.ToInt32(_estNum), _contactEmail, _contactNm, DateTime.Now.ToString("MM-dd-yyyy"), DateTime.Now.ToString("T"), mode);
}
}
}
}
}