Jmail组件使用方法(asp)

Function SendMail(MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom)
'函数参数说明(收件人地址,收件人姓名(可选),主题,邮件内容,发件人姓名(可选),发件人地址)
'on error resume next
Dim JMail,MailServer,Flag
Set JMail=Server.CreateObject("JMail.Message")
If err Then
SendMail = False
err.clear
Exit Function
End if
JMail.Charset="gb2312" '邮件编码
JMail.silent=True
JMail.ContentType = "text/html" '邮件正文格式
MailServer = "smtp.126.com" '用来发送邮件的SMTP服务器
JMail.MailServerUserName = "xiaonan126" '登录用户名 /注意:这里是填写你在163申请的邮箱账号
JMail.MailServerPassWord = "840629" '登录密码 /注意:这里是填写你在163邮箱账号的对应密码
JMail.MailDomain = "126.com" '域名(如果用"[email protected]"这样的用户名登录时,请指明domain.com),可选
JMail.AddRecipient MailtoAddress,MailtoName '收信人邮箱和收信人名称
JMail.Subject = Subject '主题

JMail.AppendHTML(MailBody)
JMail.FromName = FromName '发信人姓名
JMail.From = MailFrom '发信人Email
JMail.Priority = 1 '邮件等级,1为加急,3为普通,5为低级
Flag=JMail.Send(MailServer)
If Flag Then
SendMail=True
Else
SendMail=False
End If
JMail.Close
Set JMail=nothing
if sendmail=true then
response.write ("<img src=images/x-26.jpg>")
else
response.Write ("<img src=images/x-25.jpg>")
end if
End Function
%>

你可能感兴趣的:(mail)