本文整理汇总了C#中Utility.sendEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Utility.sendEmail方法的具体用法?C# Utility.sendEmail怎么用?C# Utility.sendEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility.sendEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
Utility uObj = new Utility();
string st_errorMessage = string.Empty;
String fpLevel = String.Empty;
String nextLevel = ddNextLevel.SelectedValue.ToString();
SqlDataReader dr = FundingPlan.get_Header_Info(Convert.ToInt32(cbFundPlanVersion.SelectedValue.ToString()));
if (dr.HasRows)
{
while (dr.Read())
{
fpLevel = dr["key_funding_plan_level_id"].ToString();
}
}
String user = string.Empty;
try
{
user = Session[Session.SessionID + "displayname"].ToString();
}
catch { }
//Submit Funding Plan
try
{
tblRes.Text = FundingPlan.update_FundingPlan(Convert.ToInt32(hfLocal_plan_id.Value), Convert.ToInt32(cbFundPlanVersion.SelectedValue), Convert.ToInt32(nextLevel), user);
}
catch
{
}
if (tblRes.Text == "101")
{
Get_emailbodysubject_for_fundingplan(cbFundPlanVersion.SelectedValue.ToString());
string revisionreason = "";
if (ddNextLevel.SelectedValue == "104")
{
revisionreason = System.Environment.NewLine + "<br/><P />Revision Reasons:" + Server.HtmlEncode(txtComments.Text);
}
uObj.sendEmail(emailfundplansubject, emailfundplanbody + revisionreason, Get_emailaddresses_for_fundingplan(cbFundPlanVersion.SelectedValue.ToString()));
dsFundPlanVersion.DataBind();
cbFundPlanVersion.DataBind();
if (dsNextLevel.SelectParameters.Count > 0)
{
dsNextLevel.SelectParameters.RemoveAt(0);
}
dsNextLevel.SelectParameters.Add(new Parameter("p_nbr_current_lp_next_level_nbr", TypeCode.Int32, nextLevel));
dsNextLevel.DataBind();
ddNextLevel.DataBind();
cbFundPlanVersion.DataBind();
int itemcount = cbFundPlanVersion.Items.Count;
cbFundPlanVersion.SelectedIndex = cbFundPlanVersion.Items.IndexOf(cbFundPlanVersion.Items[itemcount - 1]);
}
else
{
SqlConnection myerrconn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["sctcs_perkinsConnectionString"].ConnectionString);
SqlCommand myerrcomm = new SqlCommand("Select txt_message from scs_perkins_sys_messages where key_perkins_sys_message_id = " + tblRes.Text, myerrconn);
if (myerrconn.State != ConnectionState.Open)
myerrconn.Open();
HL_ErrorMessage.Visible = true;
st_errorMessage = myerrcomm.ExecuteScalar().ToString();
HL_ErrorMessage.Text = "* Errors";
HL_ErrorMessage.NavigateUrl="javascript:showerrors('" + st_errorMessage + "');";
lblErr.Text = st_errorMessage;
lblErr.Visible = true;
uObj.sendEmail("Submit Funding Plan: " + cbFundPlanVersion.SelectedValue.ToString(), "fpLevel: " + fpLevel + ", nextLevel: " + nextLevel + "<br />Failed. <br/>" + st_errorMessage, "[email protected],[email protected],[email protected]");
}
// This segment is took out because it disable the Submit button (VV)
//if (fpLevel == "104")
//{
// btnSubmit.Enabled = false;
//}
}
示例2: SendPlanLeveledEmail
private void SendPlanLeveledEmail()
{
try
{
DataView dv_EmlRecep = (DataView)SQLRL_EMAILRECEP.Select(DataSourceSelectArguments.Empty);
DataView dv_EmlSub = (DataView)SQLRL_EMAILBODYSUB.Select(DataSourceSelectArguments.Empty);
string ReCEP_LIST = "";
Utility myobj = new Utility();
if (dv_EmlRecep.Table.Rows.Count > 0)
{
if (ddlLpNExtLevel.SelectedValue == "102" || ddlLpNExtLevel.SelectedValue == "103")
{
foreach (DataRowView dr in dv_EmlRecep)
{
ReCEP_LIST += (dr["txt_email"] + ",");
}
myobj.sendEmail(dv_EmlSub.Table.Rows[0]["txt_subject"].ToString(), dv_EmlSub.Table.Rows[0]["txt_body"].ToString(), ReCEP_LIST.ToString());
}
}
}
catch
{
}
}