- ·上一篇文章:针对搜索引擎最佳方式:8个步骤优化网站
- ·下一篇文章:检测你的SQL Server是否有特洛伊木马
如何在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就可以完成邮件的发送了!
Tags:
相关资讯
其他资讯
- › 苹果iOS 8.3 beta 4测试版发布
- › 微星24相供电旗舰X79主板Big Bang XPower II亮相
- › Win10 UWP《Skype预览版》更新:提升电话和交互性
- › 下载:Adobe Flash Player 10.1.53.55 RC5发布
- › NVIDIA发布显卡驱动301.42 WHQL版 支持Kepler
- › 驱动精灵2009 B1版For Windows7
- › 国产最美手机vivo X5Pro正式发布:2598元
- › 三星4.5寸双核Galaxy S Blaze 4G美国开售
- › 接奔驰、宝马之后 奥迪全系车型官降,最高降5.5万元
- › 诺基亚将在美国开售粉红色Lumia 900