本文整理汇总了C#中Email.toSend方法的典型用法代码示例。如果您正苦于以下问题:C# Email.toSend方法的具体用法?C# Email.toSend怎么用?C# Email.toSend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Email
的用法示例。
在下文中一共展示了Email.toSend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_add_click
//.........这里部分代码省略.........
wn.Status = "維修中";
switch (this.DropDownList_RepairDateOption_add.SelectedIndex)
{
case 0:
//修復日期選項
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "window.alert('請點選修復日期選項!');", true);
return;
//break;
case 1:
wn.RepairDateOption = 1;
break;
case 2:
wn.RepairDateOption = 2;
break;
case 3:
wn.RepairDateOption = 3;
wn.RepairDeadline = Convert.ToDateTime(this.TextBox_RepairDeadline_add.Text);
break;
}
wn.Add();
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "window.alert('新增成功');", true);
UpdateServerData();
}
if (chk_isSendMail.Checked)
{
try
{
//傳送通知email給廠商
string[] mailaddress = new string[1];
SQLDB _operateor = new SQLDB();
DataSet ds = new DataSet();
ds = _operateor.Select("CompanyID ='" + DropDownList_WarrantyCompany_add.SelectedValue + "'", "", "Company");
if (ds.Tables[0].Rows.Count > 0)
{
mailaddress[0] = ds.Tables[0].Rows[0]["Email"].ToString();
}
Email notifyemail = new Email();
//通報內容
//string body = "";
string first_td = " <td width='150' align='center' style='background-color: #c4ffde;' > ";
string second_td = " <td align='center' style='background-color: #ffff9d;' > ";
StringBuilder body = new StringBuilder();
body.Append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
body.Append("<HTML><HEAD><META http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");
body.Append("</HEAD><BODY>");
body.Append(" <table width='80%' border='1' align='center' cellpadding='0' cellspacing='0'>");
body.Append(" <tr> ");
body.Append(" <td colspan='2' align='center' style='background-color: #ffcc33;'><h3> " + "新北市停車管理系統報修服務單" + "</h3> </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(first_td + "設備編號" + " </td> ");
body.Append(second_td + TextBox_DeviceID_add.Text + " </td> ");
body.Append(" </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(first_td + "通報者" + " </td> ");
body.Append(second_td + reportid + " </td> ");
body.Append(" </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(first_td + "通報時間" + " </td> ");
body.Append(second_td + TextBox_NotifyDate_add.Text + " </td> ");
body.Append(" </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(first_td + "指定修復日期" + " </td> ");
body.Append(second_td + TextBox_RepairDeadline_add.Text + " </td> ");
body.Append(" </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(first_td + "損壞原因描述" + " </td> ");
body.Append(second_td + TextBox_FaultDescribe_add.Text + " </td> ");
body.Append(" </td> ");
body.Append(" </tr> ");
body.Append(" <tr> ");
body.Append(" <td colspan='2' align='center' style='background-color: #cccc99;'> " + "本郵件由發信系統主動發出,請勿直接回覆,如有任何問題或意見,請撥電話至停管中心" + " </td> ");
body.Append(" </tr> ");
body.Append(" </table> ");
body.Append("</BODY></HTML>");
if (notifyemail.toSend("新北市停車管理系統報修服務單", mailaddress, body.ToString()))
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "window.alert('郵件寄送成功');", true);
}
}
catch (Exception ee)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "window.alert('新增保固單失敗!');", true);
}
}
}