用Jmail组件发送邮件

Function ShopSendEmail(strToEmail,strTitle,strSubject)
    On Error Resume Next
    Set jmail = Server.CreateObject("JMail.Message")
    jmail.Charset = "gb2312"
    jmail.ContentType = "text/html"
    jmail.from =  [email protected] ‘发信人邮件地址
    jmail.silent = True
    jmail.Logging = True
    jmail.FromName = “飞飞" '发件人的姓名
    jmail.mailserverusername = "feifei" 'SMTP验证帐号,也就是发信人的用户名
    jmail.mailserverpassword = "feifei" 'SMTP认证密码,也就是发信人的密码
    jmail.AddRecipient strToEmail
    jmail.body = strSubject   ’邮件内容
    jmail.Subject = strTitle   ‘邮件标题
    jmail.Priority = 1
    If Not jmail.Send (JMailSMTP) Then  ’JMailSMTP为发件服务器,如mail.8sea.com,需要与SMTP验证信息对应
        response.Write "错误!你还没有安装相关组件。"
    Else
        response.Write "发送成功!"
    End If
    Set jmail=Nothing
End Function

你可能感兴趣的:(mail)