主题:  头疼的Jmail

楚楚

职务:普通成员
等级:1
金币:1.0
发贴:187
#12003/10/26 10:53:39
下面这段代码,提示:对象不支持此属性或方法: 'JMail.Execute'
没有这个,这个程序不能用呀。请问有办法解决吗?

<%
function SendMail(mailto,subject,msg)
dim JMail
'on error resume next
Set JMail = Server.CreateObject("JMail.Message")
JMail.Logging=True
JMail.Charset="gb2312"
JMail.ContentType = "text/plain"
JMail.Priority=1
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.MailServerUserName = "webmaster@123.net"
JMail.MailServerPassword = "123456"
JMail.From = "webmaster@123"
JMail.FromName = "俱乐部"
JMail.Subject = "恭喜您注册成功"

JMail.Body = msg
JMail.Priority = 1
JMail.AppendBodyFromFile(Server.MapPath("Inc/Mailend.txt"))
JMail.AddRecipient mailto
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
SendMail = JMail.Execute
JMail.Close
set JMail=nothing
call RecordLog(mailto,subject,msg)
end function

function NeedMail(MType,ToID,subject,msg)
dim Rs,sql,Rss
set Rs=server.createobject("adodb.recordset")
sql="select email from user_reg where user_id=" & ToID
Rs.open sql,conn,1,1
If Not Rs.Eof Then
set Rss=server.createobject("adodb.recordset")
sql="select * from user_option where user_id=" & Cint(ToID)
Rss.open sql,conn,1,1
If Not Rss.Eof Then
TType=Rss(MType)
Else
TType=True
End If
Rss.Close
set Rss=Nothing
If TType=True Then
If Rs("email")<>"" Then
call SendMail(Rs("email"),subject,msg)
End If
End If
End If
Rs.Close
end function

function RecordLog(mailto,subject,msg)
Dim LogFileName,FileObject,Out
LogFileName=Server.MapPath("mdb/maillog.txt")
Set FileObject=Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set Out=FileObject.OpenTextFile(LogFileName,8,True)
Out.WriteLine("Time : " & Now())
Out.WriteLine("MailTo : " & mailto)
Out.WriteLine("Subject : " & subject)
Out.WriteLine("Contents : ")
Out.WriteLine(msg)
Out.WriteLine("----------")
Out.WriteLine()
Out.Close
end function
%>