jmail发邮件的代码

来源:互联网 发布:淘宝店叫什么名字好 编辑:程序博客网 时间:2024/06/09 22:49
<%
Set jmail = Server.CreateObject("JMAIL.Message")'建立发送邮件的对象
'response.Write(sendFrom&"-"&sendTO&"-"&smtpserver&"-"&sendusername&"-"&sendpassword&"-"&subject&"-"&message&"-"&SendName)
jmail.silent = false '屏蔽例外错误,返回FALSE跟TRUE两值
jmail.logging = false '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
jmail.ContentType = "text/html" '邮件的格式为HTML格式
jmail.AddRecipient "gaingame@163.com" '邮件收件人的地址
jmail.From = "gaingame@163.com" '发件人的E-MAIL地址
jmail.FromName = "gaingame" '发件人的名字
jmail.MailServerUserName = "gaingame" '登录邮件服务器所需的用户名
jmail.MailServerPassword = "gaingame" '登录邮件服务器所需的密码
jmail.Subject = "fine to see you friend" '邮件的标题
jmail.Body="ddd" '邮件的内容
'jmail.Prority =1 '邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值 (我使用的是w3jmail4不知道为什么不注释此项就是发送不成功)
'jmail.Send("smtp.163.com") '执行邮件发送(通过邮件服务器地址)
if(not jmail.Send ("smtp.163.com")) then '发送并判断发送是否成功
SendMail="<center>Fail to send the Email 2!</center>"
else
SendMail="<center>Success!</center>"
end if
response.Write(sendmail)
jmail.Close() '关闭对象%> 
原创粉丝点击