请问ASP.net中如何实现发送E-mail的功能? 请问ASP.net中如何实现发送E-mail的功能? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用cdo组件发送 这样的帖子 太多了 楼主找找 有现成的email发送类,自己搜 推荐用jmail组件相关资料可以往上搜索一下 private void btnSend_Click(object sender, System.EventArgs e){ MailMessage myMail = new MailMessage(); SmtpMail.SmtpServer="smtp.sina.com.cn";//发送服务器 myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");//认证 myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","xxx");//用户名 myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","xxx");//密码 myMail.To=txtTo.Text.Trim();//收信人 myMail.From=txtFrom.Text.Trim();//寄信人 myMail.Subject=txtTitle.Text.Trim();//主题 myMail.Body=txtContent.Text;//内容 myMail.BodyFormat=MailFormat.Text;//正文格式 myMail.Priority=MailPriority.High;//优先级 string result=""; try { SmtpMail.Send(myMail); result="邮件发送成功!"; } catch(Exception error) { result="邮件发送失败!"+error.Message; } finally { Response.Write("<script language='javascript'>window.alert('"+result+"');window.close();</script>"); }} 超级无敌急啊哥哥姐姐们 js判断ListBox是否有值被选中问题 数据库中数据在页面显示问题??? 这个比较难的... WebRequest的使用问题 GridView 扩展 请问一个webhtmleditor(lionsky)控件获取上传文件名的问题 !做一个电子书下载网站的困惑 使用DataSet对象访问XML数据出问题? 奇怪的问题,关于IIS 虚拟目录所在的分区空间不够了,需要添加新硬盘,可以把该硬盘上的分区并入虚拟目录的分区吗? 百思不得其解,关于DataGrid模板列中得到CheckBox的Checked为true的问题 Sql中什么类型可以存一本书的字数.急急急急急????
相关资料可以往上搜索一下
{
MailMessage myMail = new MailMessage();
SmtpMail.SmtpServer="smtp.sina.com.cn";//发送服务器
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");//认证
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername","xxx");//用户名
myMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword","xxx");//密码
myMail.To=txtTo.Text.Trim();//收信人
myMail.From=txtFrom.Text.Trim();//寄信人
myMail.Subject=txtTitle.Text.Trim();//主题
myMail.Body=txtContent.Text;//内容
myMail.BodyFormat=MailFormat.Text;//正文格式
myMail.Priority=MailPriority.High;//优先级
string result="";
try
{
SmtpMail.Send(myMail);
result="邮件发送成功!";
}
catch(Exception error)
{
result="邮件发送失败!"+error.Message;
}
finally
{
Response.Write("<script language='javascript'>window.alert('"+result+"');window.close();</script>");
}
}