这个例子只有两句话:)首先要imports system.web.mail
然后:
dim mailMessage as SmtpMail
mailMessage.SMTPServer="xx.xx.xx.xx"
mailMessage.Send("[email protected]","[email protected]","TITLE","Content!")上面的代码要可用,一个先决条件是mailMessage.SMTPServer="xx.xx.xx.xx",指定的这个邮件服务器要可用才行!
然后:
dim mailMessage as SmtpMail
mailMessage.SMTPServer="xx.xx.xx.xx"
mailMessage.Send("[email protected]","[email protected]","TITLE","Content!")上面的代码要可用,一个先决条件是mailMessage.SMTPServer="xx.xx.xx.xx",指定的这个邮件服务器要可用才行!
解决方案 »
- Asp.Net 找不到自定义控件错误
- 关于字符串的问iti
- 在ASP.NET中往数据库中插入记录
- Asp.net怎么样把数据库中的二进制还原为图片绑定到DataList中?
- 出错了!您的请求无法被转送到原始网络服务器或其他的上层缓存服务器???
- ASP.Net与Application中使用m_objExcel = new Excel.Application();????
- 面试呀
- 高分在线等关于CheckBoxList的问题高手只要几秒就可以搞定马上接帖子
- 关于VB和C#,在ASP.NET中到底用哪种好
- vs2010 如何调用后台函数
- 高手请进!!!唔知你们有没有考虑过这个问题呢????
- 新手急问:树形控件中动态生成的CheckBox,能否捕获其状态改变?
Dim myMail as new mailMessage()mymail.to = "[email protected]"
mymail.from = "Asp.net Mail"
mymail.subject = "This is test"
mymail.priority = mailpriority.heig
mymail.body = "Hello world"smtpmail.send(mymail)前提是你要安装smtp服务器
ms.To=email; //string email是对方邮箱地址
ms.From="自己的邮箱地址"; //可以是任意可用smtp地址
ms.Subject="title"; //邮件标题
ms.Body=TextBox2.Text; //正文
ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
//是否需要验证,一般是要的
ms.Fields.Add
("http://schemas.microsoft.com/cdo/configuration/sendusername", "用户名");
//自己邮箱的用户名
ms.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "密码");
//自己邮箱的密码 SmtpMail.SmtpServer="smtp.chuguo.org.cn"; //自己邮箱的邮件服务器地址
SmtpMail.Send(ms); //发送
//注:运行该程序时不要开启瑞星的邮件发送监控,否则cpu使用率100%,在vs2003,win2003 下测试通过