一聚教程网:一个值得你收藏的教程网站

热门教程

asp发送邮件代码

时间:2022-07-02 22:43:16 编辑:袖梨 来源:一聚教程网


function SendMail(MailServerAddress,AddRecipient,Subject,Body,Sender,MailFrom)
 on error resume next
 Dim JMail
 Set JMail=Server.CreateObject("JMail.SMTPMail")
 if err then
  SendMail= "
  • 没有安装JMail组件
  • "
      err.clear
      exit function
     end if
     JMail.Logging=True
     JMail.Charset="gb2312"
     JMail.ContentType = "text/html"
     JMail.ServerAddress=MailServerAddress
     JMail.AddRecipient=AddRecipient
     JMail.Subject=Subject
     JMail.Body=MailBody
     JMail.Sender=Sender
     JMail.From = MailFrom
     JMail.Priority=1
     JMail.Execute
     Set JMail=nothing
     if err then
      SendMail=err.description
      err.clear
     else
      SendMail="OK"
     end if
    end function

    热门栏目