cs嵌html5页面,在.cs c#.net中包含HTML页面
所以我正試圖清理后端,并收集我的電子郵件。有沒有一種方法可以將html包含到html文件中,而不是直接在這里放置html?或者更好的方法來做到這一點?
public void SendWelcomeEmail(int uid)
{
SqlCommand command = EmailCommandList.GetRegisteredEmail;
BciDatabase db = new BciDatabase("db");
command.Parameters["@User_Id"].Value = uid;
using (SqlDataReader dr = db.ExecuteReader(command))
{
Member member = new Member();
if (dr != null && !dr.IsClosed && dr.Read())
{
while (dr.Read())
{
string emailAddress = (string)dr["Email"];
MailMessage mail = new MailMessage();
mail.Subject = "Welcome to the site";
mail.Body = "
Hello, welcome to the site!";
mail.IsBodyHtml = true;
mail.From = new MailAddress("noreply@email.com");
mail.To.Add(new MailAddress(emailAddress));
var client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential("myemail", "mypass"),
EnableSsl = true
};
client.Send(mail);
}
}
}
}
總結
以上是生活随笔為你收集整理的cs嵌html5页面,在.cs c#.net中包含HTML页面的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求几首男生唱的闽南歌曲要欢快的,经典的
- 下一篇: html iso标准文档,HTML IS