设为首页 加入收藏高级搜索·你问我答 知识就像内裤,看不见但很重要!~
入门新手学电脑认识硬件术语
教程视频教程笔记本教程图像
系统BIOS设置安装优化配置
故障不开机死机蓝屏变慢断网
安全查木马防火墙局域网防护
XPWin7Win8Vista2003linux
选购组装DIY笔记本台式机健康
网络组网无线英特网网络维护
软件QQ聊天WordExcel其他软件
资讯热门美女游戏电影
问答硬件软件网络数码
下载必备办公桌面主题
当前位置:学电脑网 -> 电脑教程 -> 网页设计教程 -> HTML教程 > 正文

asp发邮件代码怎么写?(一)

2012-05-21 21:47:48作者: 浏览:1086我要评论(0)
字号:T|T

编写asp发邮件代码小提示:这个功能的前提是要装上WINDOWS NT OPTON PACK 的SMTP SERVICE。

  首先

  Set mail = Server.CreateObject("CDONTS.NewMail")以呼叫SMTP Service的元件,然后设定:

  mail.To = "收件者E-Mail地址"

  mail.From = "寄件者的E-Mail地址"

  mail.Subject = "主旨"

  mail.Body = "E-mail内文"

  最后Mail.Send即开始发送邮件。

  例如:

  <%

  Set mail = Server.CreateObject("CDONTS.NewMail")

  mail.TO = "abc@xxx.com"

  mail.From = "yourmail@xxx.com"

  mail.Subject = "主题"

  mail.Body = "E-Mail内容"

  mail.Send

  %>

  一切OK了!哈哈,很简单咧!赶紧动手去试试看吧!

---------------------------------------------------------------------------

asp发送邮件代码(网友作品)简单实用推荐:

<%
E_Server = "mail.1488.com" ''发件服务器
E_ServerUser = "joy@1488.com" ''登录用户名
E_ServerPass = "123456" ''登录密码
E_SendManMail = "joy@1488.com" ''发件人邮件地址
E_SendManName = "系统管理员" ''发件人姓名

Sub Jmail(Email,Topic,Mailbody)
On Error Resume Next
Dim JMail
Set JMail = Server.CreateObject("JMail.Message")
JMail.silent=true
JMail.Logging = True
JMail.Charset = "gb2312"
If Not(E_ServerUser = "" Or E_ServerPass = "") Then
JMail.MailServerUserName = E_ServerUser
JMail.MailServerPassword = E_ServerPass
End If
JMail.ContentType = "text/html"
JMail.Priority = 1
JMail.From = E_SendManMail
JMail.FromName = E_SendManName
JMail.AddRecipient Email
JMail.Subject = Topic
JMail.Body = Mailbody
JMail.Send (E_Server)
Set JMail = Nothing
SendMail = "OK"
If Err Then SendMail = "False"
End Sub

Sub Cdonts(Email,Topic,Mailbody)
On Error Resume Next
Dim ObjCDOMail
Set ObjCDOMail = Server.CreateObject("CDONTS.NewMail")
ObjCDOMail.From = E_SendManMail
ObjCDOMail.To = Email
ObjCDOMail.Subject = Topic
ObjCDOMail.BodyFormat =

热点图文

      表  情:
      验 证 码:
      请文明发言,署名或者登录评论!(署名需要验证码)