登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

樱之花

叶散的时候,你明白欢聚;花谢的时候,你明白青春.

 
 
 

日志

 
 
关于我

分类中“我的实验室”是我在日常工作中的一些知识总结,有些写的比较匆忙,可能大家在阅读时会产生困扰,后期有时间我会重新整理编辑,谢谢大家的到访,您们的支持是我前进的动力!

ASP发送Email  

2009-04-22 13:33:38|  分类: ASP开发 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

<%

E_Server = "www.126.com" ''发件服务器

E_ServerUser = "subendong" ''登录用户名

E_ServerPass = "" ''登录密码

E_SendManMail = "subendong@126.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"

response.Write(SendMail)

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 = 0

    ObjCDOMail.MailFormat = 0

    ObjCDOMail.Body = Mailbody

    ObjCDOMail.Send

    Set ObjCDOMail = Nothing

    SendMail = "OK"

    If Err Then SendMail = "False"

response.Write(SendMail)

End Sub

Sub Aspemail(Email,Topic,Mailbody)

    On Error Resume Next

    Dim Mailer

    Set Mailer = Server.CreateObject("Persits.MailSender")

    Mailer.Charset = "gb2312"

    Mailer.IsHTML = True

    Mailer.username = E_ServerUser

    Mailer.password = E_ServerPass

    Mailer.Priority = 1

    Mailer.Host = E_Server

    Mailer.Port = 25

    Mailer.From = E_SendManMail

    Mailer.FromName = E_SendManName

    Mailer.AddAddress Email,Email

    Mailer.Subject = Topic

    Mailer.Body = Mailbody

    Mailer.Send

    SendMail = "OK"

    If Err Then SendMail = "False"

response.Write(SendMail)

End Sub

dim SendMail

Sub SendEmail(Mailto,Subject,HtmlCode,SendMode)

    if SendMode="" then

     SendMode="Jmail"

end if

    if SendMode="Jmail" then

        Jmail MailTo,Subject,HtmlCode

    elseif SendMode="Cdonts" then

        Cdonts MailTo,Subject,HtmlCode

    elseif SendMode="Aspemail" then

        Aspemail MailTo,Subject,HtmlCode

    end if

End Sub

SendEmail "subendong@126.com","苏本东","苏本东,你好!","Cdonts"

%>

  评论这张
 
阅读(532)| 评论(0)

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018