日期:2014-05-17  浏览次数:21099 次

jmail发送邮件的问题
操作系统是2003   server,安装了jmail4.4组件,将jmail.dll拷到system32文件夹下并注册成功!

程序代码是:
smtpserver= "smtp.163.com "  
smtpusername= "aaaa@163.com "
smtppwd= "aaabbb "
myemail=s_email
smtpname=s_linkman
topic= "用户名和密码 "
mailbody= "这是内容 "
set   jmail=   server.CreateObject( "jmail.message ")
jmail.Silent   =   true
jmail.Charset   = "GB2312 "    
jmail.ISOEncodeHeaders=false  
JMail.ContentType= "text/html "
jmail.Priority   =   3  
jmail.fromname=smtpname
jmail.from=smtpusername
jmail.subject=topic
jmail.Body   =trim(mailbody)  
jmail.MailServerUserName   =smtpusername
jmail.MailServerPassWord   =smtppwd
jmail.AddRecipient   trim(myemail)
jmail.Send(smtpserver)
If   Err   Then
Response.Write   ( " <script> alert( ' "&err.description& " '); </script> ")
Err.Clear
Else
Response.Write   ( " <script> alert( '邮件发送成功! '); </script> ")
End   If

jmail.Close
set   jmail   =   nothing

报缺少对象错误,不知道在哪里,请各位帮忙看看

------解决方案--------------------
如果是set jmail= server.CreateObject( "jmail.message ")行出错,估计你的jmail有问题,另外jmail也有好多版本,并且用法上有些微的差别。保证安装正常,并且代码正确对应你的jmail组件。