本文整理汇总了C#中DBLayer.GetAllMails方法的典型用法代码示例。如果您正苦于以下问题:C# DBLayer.GetAllMails方法的具体用法?C# DBLayer.GetAllMails怎么用?C# DBLayer.GetAllMails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBLayer
的用法示例。
在下文中一共展示了DBLayer.GetAllMails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: uiLinkButtonSubmit_Click
protected void uiLinkButtonSubmit_Click(object sender, EventArgs e)
{
try
{
int id = Convert.ToInt32(Request.QueryString["TID"].ToString());
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetTourismlistContent(id);
MailMessage msg = new MailMessage();
DataSet to = db.GetAllMails();
foreach (DataRow item in to.Tables[0].Rows)
{
msg.To.Add(item["Email"].ToString());
}
//msg.To.Add("[email protected]");
msg.From = new MailAddress("[email protected]");
//msg.From = new MailAddress("[email protected]");
msg.Subject = " Email from booking page";
msg.IsBodyHtml = true;
msg.BodyEncoding = System.Text.Encoding.Unicode;
msg.Body = " الإسم : " + uiDropDownListTitle.Text + " " + uiTextBoxName.Text;
msg.Body += "<br/> البريد الإلكترونى : " + uiTextBoxEmail.Text;
msg.Body += "<br/> الشارع : " + uiTextBoxStreet.Text;
msg.Body += "<br/> المدينة : " + uiTextBoxCity.Text;
msg.Body += "<br/> الرقم البريدى : " + uiTextBoxPostalCode.Text;
msg.Body += "<br/> البلد : " + uiTextBoxCountry.Text;
msg.Body += "<br/> التليفون : " + uiTextBoxTelephone.Text;
msg.Body += "<br/> الموبايل : " + uiTextBoxMobile.Text;
msg.Body += "<br/> إسم الرحلة : " + ds.Tables[0].Rows[0]["Title"].ToString();
msg.Body += "<br/> تفاصيل الرحلة : " + Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString());
msg.Body += "<br/> الرابط على الموقع : " + Request.Url;
SmtpClient client = new SmtpClient("mail.obtravel-eg.com", 25);
//SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
//client.EnableSsl = true;
client.UseDefaultCredentials = false;
//client.EnableSsl = true;
client.Credentials = new System.Net.NetworkCredential("[email protected]", "obtravelmail");
//client.Credentials = new System.Net.NetworkCredential("[email protected]", "********");
client.Send(msg);
uiLabelMessage.Visible = true;
}
catch (Exception ex)
{
uiLabelMessage.Visible = true;
uiLabelMessage.Text = ex.Message;
}
}
示例2: BindData
private void BindData()
{
DBLayer db = new DBLayer();
DataSet ds = new DataSet();
ds = db.GetAllMails();
uiGridViewNews.DataSource = ds;
uiGridViewNews.DataBind();
}