如何在asp.net中生成电子邮件 [英] how to generate email in asp.net
问题描述
我的asp.net页面正在显示来自sql数据库的数据.
如果用户发现数据有误,可以向管理员发送有关
的电子邮件
数据更正.
我想在表格上添加一个按钮
在按钮的单击事件上,我想生成一封电子邮件,该电子邮件可以发送给管理员
我该如何实现
感谢
My asp.net page is showing data from sql database.
if user find any error in the data he can send email to admin regarding
Correction of data.
i want to add a button on the form
on click event of the button i want generate a email which can be send to admin
how can i achieve this
thanks
推荐答案
您可以尝试以下 AnLogger-ASP.NET Logger [ ^ ]
希望对您有所帮助:)
You might try this AnLogger - ASP.NET Logger[^]
Hope it helps :)
尝试一下:-
Try this:-
private void btnSend_Click(object sender, System.EventArgs e)
{
MailMessage msg = new MailMessage();
msg.To = txtTo.Text;
msg.From = txtFrom.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Value;
lblStatus.Text = "Sending...";
SmtpMail.Send(msg);
lblStatus.Text = "Sent email (" + txtSubject.Text + ") to " +txtTo.Text;
}
在ASP.Net 2.0中发送电子邮件-反馈表单 [ ^ ]
http://www.c-sharpcorner.com/UploadFile/dchoksi/SendingMail02132007002923AM/SendingMail.aspx [ ^ ]
Send Email in ASP.Net 2.0 - Feed back Form[^]
http://www.c-sharpcorner.com/UploadFile/dchoksi/SendingMail02132007002923AM/SendingMail.aspx[^]
这篇关于如何在asp.net中生成电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!