首先,必须有错误继续进行的声明On Error Resume Next
然后尝试简历jmail实例:
Dim JMail
Set JMail=Server.CreateObject("JMail.Message")
对实例做出判断,如果组件没有安装成功,则没有创建实例:
If JMail Is Nothing Then
Response.Write "不支持"
Else
Response.Write "支持"
End If
其他组件同样处理,非常简单了。
最好在global文件中处理,里面使用的时候不用那么麻烦了。
最好的方法把邮件生成放到一个表里,然后再说发送的事情。
判断代码:
if IsObjInstalled("JMail.Message")=True then{
if IsObjInstalled("JMail.Message") =True then
SendStat = Jmail("***@jb51.net","来自网上的客户留言","<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><title>网站用户留言</title></head><body>留言人:"&txtname&"<br>性别:"&xingbie&"<br>咨询网站:"&txtweb&"<br>联系方式:"&txttel&"<br>留言内容:"&content&"<br>IP地址:"&ipaddress&"<br>留言时间:"&now()&"<br><br>本邮件由系统自动发送,无须回复<!--易采站长站www.jb51.net--><br><br></body></html>","GB2312","text/html")
end if
}
jmail发信函数
然后尝试简历jmail实例:
Dim JMail
Set JMail=Server.CreateObject("JMail.Message")
对实例做出判断,如果组件没有安装成功,则没有创建实例:
If JMail Is Nothing Then
Response.Write "不支持"
Else
Response.Write "支持"
End If
其他组件同样处理,非常简单了。
最好在global文件中处理,里面使用的时候不用那么麻烦了。
最好的方法把邮件生成放到一个表里,然后再说发送的事情。
判断代码:
if IsObjInstalled("JMail.Message")=True then{
if IsObjInstalled("JMail.Message") =True then
SendStat = Jmail("***@jb51.net","来自网上的客户留言","<html><head><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""><title>网站用户留言</title></head><body>留言人:"&txtname&"<br>性别:"&xingbie&"<br>咨询网站:"&txtweb&"<br>联系方式:"&txttel&"<br>留言内容:"&content&"<br>IP地址:"&ipaddress&"<br>留言时间:"&now()&"<br><br>本邮件由系统自动发送,无须回复<!--易采站长站www.jb51.net--><br><br></body></html>","GB2312","text/html")
end if
}
jmail发信函数









