using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; //倒入命名空间 using System.Net; using System.Net.Mail;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
} protected void Button1_Click(object sender, EventArgs e) { ////设置发件人信箱,及显示名字 MailAddress from = new MailAddress("zgdx0503@cpp114.com", "延边职大信息中心"); //设置收件人信箱,及显示名字 MailAddress to = new MailAddress(TextBox1.Text, "0503班"); //创建一个MailMessage对象 MailMessage oMail = new MailMessage(from, to);