首 页新闻资讯影视剧情购物商城星座运程网址导航
当前位置:九悦网新闻资讯程序开发

如何在ASP.NET中使用SmtpMail发送邮件

来源:本站整理   作者:佚名   发布时间:2009-02-09 11:30:33

<%@ Import Namespace="System.Web.Mail" %><script runat="server">MailMessage mail=new MailMessage();mail.From="service@brookes.com";mail.To="brookes@brookes.com";mail.BodyFormat=MailFormat.Text;mail.Body="a test smtp mail.";mail.Subject="r u

ok?";mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "brookes"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "walkor"); //set your password here SmtpMail.SmtpServer="lsg.moon.net";SmtpMail.Send(mail);</script>

有了这种方法,终于可以不必再借助于Jmail、EasyMail等第三方组件,而只简单使用SmtpMai就可以完成邮件的发送了!

上一页  [1] [2] 

Tags:

关于本站 | 网站帮助 | 广告合作 | 九悦网声明 | 友情连接 | 网站地图
Copyright © 九悦网 . All Rights Reserved .
页面执行时间:126,839.80000 毫秒