给你个准保能用的例子:
sub SendMail(title,content,mfrom,mto,username,password,fromname,smtp)
set Jmail= Server.CreateObject("JMAIL.Message") 'create the object
Jmail.silent = true'pass error
Jmail.logging = true 'user mail log
Jmail.Charset = "gb2312" 'chartset
Jmail.ContentType = "text/html"'format html
mtoArr=split(mto,"")
mtoMax=Ubound(mtoArr)
if mtoArr(mtoMax)="" then
mtoMax=mtoMax-1
end if
for i=0 to mtoMax
jmail.AddRecipient mtoArr(i)
next
Jmail.From = mfrom 'sender's email address
Jmail.FromName=fromname
Jmail.MailServerUserName = username 'username
Jmail.MailServerPassword = password 'password
Jmail.Subject = title'title
Jmail.Body = content 'content
Jmail.Priority = 1 'mail important 1 fastest,5 lowest,3 default
Jmail.Send(smtp) 'send the mail now
Jmail.Close() 'close object
end sub
用了好多年了。
JMAIL下载链接:http://www.ajiang.net/products/download/coms/jmail44_free.zip
GMAIL的帐号可用不了的。只能用非SSL加密传输的!像163的可以,163的你要有SMTP功能的才行。
smtpmail发件时不需要身份验证,message需要身份验证。Jmail.message是Jmail组件高版本才有的方法!
为了兼容低版本,保留了smtpmail!!!
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)