这两天用户需要实现一个局域网发送邮件的功能,通过微软cdonts.dll newmail 方法可以很容易实现。(windowsXP,windows 2003 server 没有这个组件,可以到2k %windows%/system32拷贝一个,或者点击这里下载)
核心代码如下:
Dim mailobject
Set mailobject = Server.CreateObject(CDONTS.NewMail)
with mailobject
.From = mailfrom '发件人email
.To = mailto '收件人email
.Subject = 主题
.Body = 内容
.Send
Set mailobject = nothing
核心代码如下:
Dim mailobject
Set mailobject = Server.CreateObject(CDONTS.NewMail)
with mailobject
.From = mailfrom '发件人email
.To = mailto '收件人email
.Subject = 主题
.Body = 内容
.Send
Set mailobject = nothing