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

最新下载

热门教程

asp使用jmail 发邮件代码

时间:2008-07-07 编辑:简简单单 来源:一聚教程网


要用jmail  组件后才能使用哦.
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(Newasp.MailUserName = "" Or Newasp.MailPassword = "") Then
  JMail.MailServerUserName = Newasp.MailUserName '您的邮件服务器登录名
  JMail.MailServerPassword = Newasp.MailPassword '登录密码
 End If
 JMail.ContentType = "text/html"
 JMail.Priority = 1
 JMail.MailDomain = "govery.cn"
 JMail.From = Newasp.MailFrom  '邮件地址
 JMail.FromName = Newasp.SiteName  '网站名称
 JMail.AddRecipient email
 JMail.Subject = topic
 JMail.Body = mailbody
 If Err <> 0 Then
  SendMail="False"
 Else
  JMail.Send (Newasp.MailServer)   '发邮件服务器地址
  JMail.ClearRecipients()
  If Err <> 0 Then
   SendMail="False"
  Else
   SendMail="OK"
  End If
 End If
 Set JMail=nothing
End Sub

热门栏目