本文整理汇总了C#中Common.SendMail方法的典型用法代码示例。如果您正苦于以下问题:C# Common.SendMail方法的具体用法?C# Common.SendMail怎么用?C# Common.SendMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common.SendMail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnUpdate_Click
protected void btnUpdate_Click(object sender, EventArgs e)
{
ProjectTeamData ptd = new ProjectTeamData();
Common common = new Common();
string message;
try
{
for (int i = 0; i < dgTop20Projects.Rows.Count; i++)
{
CheckBox joinCheckBox = checked((CheckBox)dgTop20Projects.Rows[i].FindControl("JoinProject"));
HyperLink titleHyperlink = checked((HyperLink)dgTop20Projects.Rows[i].FindControl("hlProjectTitle"));
if (joinCheckBox.Checked)
{
string subject = "A user has shown interest in your Project: " + titleHyperlink.Text + ", posted on Beta Job Jar website";
//Extract the project Id from the title hyperlink
string projectID = titleHyperlink.NavigateUrl.ToString();
projectID = projectID.Substring(31);
int length = projectID.Length;
length = length - 1;
projectID = projectID.Substring(0, length);
ptd.AddTeamMember(Convert.ToInt32(projectID), titleHyperlink.Text, dgTop20Projects.Rows[i].Cells[2].Text, Convert.ToInt32(hidUserId.Value), ((TextBox)dgTop20Projects.Rows[i].FindControl("Comments")).Text);
string body = "Hi, \n The below user has shown interest in your Project:" + titleHyperlink.Text + " (https://betasandbox.accenture.com/BetaJobJar/Post%20Project.aspx?mode=edit&projectid=" + projectID + ") , posted on Beta Job Jar website. \n\n Name :" + Common.GetUserName() + "\n View People Page Profile (https://people.accenture.com/personal/MySite/Person.aspx?accountname=DIR\\" + Common.GetUserName() + ") \n\n Please visit the website to add the member to your team. \n \n Thanks \n Beta Job Jar Team";
common.SendMail(dgTop20Projects.Rows[i].Cells[2].Text + "@accenture.com", subject, body);
}
}
Response.Redirect(Request.Url.ToString());
}
catch (Exception exc)
{
message = exc.Message.ToString();
ScriptManager.RegisterStartupScript(this, typeof(string), "Error", "alert('" + message + "');", true);
}
}