留言评论邮件通知博主For pjblog2.6|2.7
作者:小戒 日期:2007-12-11
如题,看到某些朋友需要,花了会儿功夫弄了出来。
作者:戒聊。
发布网址:http://www.muzili.com
请注意修改步骤。特别是第4.1,4.2和第8步。
如有疑问,请到http://www.muzili.com/article.asp?id=7832留言。
1。打开COMMON下的FUNCTION.ASP,在最后一个之前插入下列代码2
作者:戒聊。
发布网址:http://www.muzili.com
请注意修改步骤。特别是第4.1,4.2和第8步。
如有疑问,请到http://www.muzili.com/article.asp?id=7832留言。
1。打开COMMON下的FUNCTION.ASP,在最后一个
复制内容到剪贴板
程序代码
程序代码%>
复制内容到剪贴板
程序代码
程序代码Function sendmail(username,post_logID,email_commid,email_log_title,comm,post_Message) '邮件发送
if trim(blog_jmail)="1" then
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = blog_smtpuser
msg.MailServerPassword = blog_smtppassword
msg.From = blog_smtpmail
msg.FromName = sitename
msg.AddRecipient blog_email,sitename
If comm=1 Then
msg.Subject = "您发表的文章《"&email_log_title&"》已有客人发表了评论"
msg.Body = "["&username&"]在您的博客中发表了评论,请点击查"&siteurl&"default.asp?id="&post_logID&"#comm_"&email_commid&"。评论内容如下:"&post_Message&""
Else
msg.Subject = "您的博客已有客人留言"
msg.Body = "["&username&"]在您的博客中发表了留言,请点击查看"&siteurl&"LoadMod.asp?plugins=GuestBookForPJBlog#book_"&email_commid&"。留言内容如下:"&post_Message&""
End if
msg.Send(blog_smtp)
msg.close
set msg = nothing
Else
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = blog_email
objMail.From =blog_smtpmail
If comm=1 Then
objMail.Subject = "您发表的文章《"&email_log_title&"》已有客人发表了评论"
objMail.Body = "["&username&"]在您的博客中发表了评论,请点击查看"&siteurl&"default.asp?id="&post_logID&"#comm_"&email_commid&"。评论内容如下:"&post_Message&""
Else
objMail.Subject = "您的博客已有客人留言"
objMail.Body = "["&username&"]在您的博客中发表了留言,请点击查看"&siteurl&"LoadMod.asp?plugins=GuestBookForPJBlog#book_"&email_commid&"。留言内容如下:"&post_Message&""
End if
objMail.Send
Set objMail = Nothing
End If
End Function
'检查组件是否被支持及组件版本的子程序
sub ObjTest(strObj)
on error resume next
IsObj=false
VerObj=""
set TestObj=server.CreateObject (strObj)
If -2147221005 <> Err then
IsObj = True
VerObj = TestObj.version
if VerObj="" or isnull(VerObj) then VerObj=TestObj.about
end if
set TestObj=nothing
End sub
if trim(blog_jmail)="1" then
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = blog_smtpuser
msg.MailServerPassword = blog_smtppassword
msg.From = blog_smtpmail
msg.FromName = sitename
msg.AddRecipient blog_email,sitename
If comm=1 Then
msg.Subject = "您发表的文章《"&email_log_title&"》已有客人发表了评论"
msg.Body = "["&username&"]在您的博客中发表了评论,请点击查"&siteurl&"default.asp?id="&post_logID&"#comm_"&email_commid&"。评论内容如下:"&post_Message&""
Else
msg.Subject = "您的博客已有客人留言"
msg.Body = "["&username&"]在您的博客中发表了留言,请点击查看"&siteurl&"LoadMod.asp?plugins=GuestBookForPJBlog#book_"&email_commid&"。留言内容如下:"&post_Message&""
End if
msg.Send(blog_smtp)
msg.close
set msg = nothing
Else
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = blog_email
objMail.From =blog_smtpmail
If comm=1 Then
objMail.Subject = "您发表的文章《"&email_log_title&"》已有客人发表了评论"
objMail.Body = "["&username&"]在您的博客中发表了评论,请点击查看"&siteurl&"default.asp?id="&post_logID&"#comm_"&email_commid&"。评论内容如下:"&post_Message&""
Else
objMail.Subject = "您的博客已有客人留言"
objMail.Body = "["&username&"]在您的博客中发表了留言,请点击查看"&siteurl&"LoadMod.asp?plugins=GuestBookForPJBlog#book_"&email_commid&"。留言内容如下:"&post_Message&""
End if
objMail.Send
Set objMail = Nothing
End If
End Function
'检查组件是否被支持及组件版本的子程序
sub ObjTest(strObj)
on error resume next
IsObj=false
VerObj=""
set TestObj=server.CreateObject (strObj)
If -2147221005 <> Err then
IsObj = True
VerObj = TestObj.version
if VerObj="" or isnull(VerObj) then VerObj=TestObj.about
end if
set TestObj=nothing
End sub
评论: 5 | 引用: 0 | 查看次数: -
blogcomm.asp代码段:
("&post_logID&",'"&post_Message&"','"&username&"',"&post_DisSM&","&post_DisUBB&","&post_disImg&","&post_DisURL&",'"&getIP()&"',"&post_DisKEY&")")
Set JMail = Server.CreateObject("JMail.Message")
JMail.silent = true
。。。。。。。。。
JMail.Send("mail.loveshot.cn")
JMail.close
set JMail= nothing
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums+1")
小戒 于 [22/12/2007 14:41:44] 回复
("&post_logID&",'"&post_Message&"','"&username&"',"&post_DisSM&","&post_DisUBB&","&post_disImg&","&post_DisURL&",'"&getIP()&"',"&post_DisKEY&")")
Set JMail = Server.CreateObject("JMail.Message")
JMail.silent = true
。。。。。。。。。
JMail.Send("mail.loveshot.cn")
JMail.close
set JMail= nothing
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)
Conn.ExeCute("update blog_Info set blog_CommNums=blog_CommNums+1")
看似没错。应该是缺少了相关变量的定义。请按照提供方法修改。
我把以下代码作为一个单独的asp文件就可以发出去,可是把它整合到blogcomm.asp就出现showmsg.asp中的空白提示框,即未出现评论发表成功等信息,查了下邮箱也未收到信,不知为什么?特来问下:
sendmail.asp
<% Set JMail = Server.CreateObject("JMail.Message")
JMail.silent = true
JMail.Logging = true
JMail.Charset = "gb2312"
JMail.MailServerUserName = "suny@loveshot.cn"
JMail.MailServerPassword = "######"
JMail.From = "suny@loveshot.cn"
JMail.FromName ="suny"
JMail.AddRecipient "zi.m.xie@gmail.com","loveshot"
JMail.Subject = "您发表的文章已有客人发表了评论"
JMail.Body = "hehe"
JMail.Send("mail.loveshot.cn")
JMail.close
set JMail= nothing
%>
sendmail.asp
<% Set JMail = Server.CreateObject("JMail.Message")
JMail.silent = true
JMail.Logging = true
JMail.Charset = "gb2312"
JMail.MailServerUserName = "suny@loveshot.cn"
JMail.MailServerPassword = "######"
JMail.From = "suny@loveshot.cn"
JMail.FromName ="suny"
JMail.AddRecipient "zi.m.xie@gmail.com","loveshot"
JMail.Subject = "您发表的文章已有客人发表了评论"
JMail.Body = "hehe"
JMail.Send("mail.loveshot.cn")
JMail.close
set JMail= nothing
%>
留言时的错误提示:
复制内容到剪贴板代码:
错误类型:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQLcomm'
/Plugins/Guestbook/bookaction.asp, 第 159 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON 2.0)
网页:
POST 148 ??? /Plugins/Guestbook/bookaction.asp
POST Data:
ChangeTime=20&username=xuting&validate=%E5%89%8D&book_face=face5&Message=+%E5%8E%85%E5%9C%A8&action=post&submit=%E5%8F%91%E8%A1%A8%E7%95%99%E8%A8%80
时间:
12 December 2007, 05:18:46
好像都是说SQLcomm未定义,请LZ帮忙解决一下,谢谢
小戒 于 [22/12/2007 14:41:44] 回复
复制内容到剪贴板代码:
错误类型:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQLcomm'
/Plugins/Guestbook/bookaction.asp, 第 159 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON 2.0)
网页:
POST 148 ??? /Plugins/Guestbook/bookaction.asp
POST Data:
ChangeTime=20&username=xuting&validate=%E5%89%8D&book_face=face5&Message=+%E5%8E%85%E5%9C%A8&action=post&submit=%E5%8F%91%E8%A1%A8%E7%95%99%E8%A8%80
时间:
12 December 2007, 05:18:46
好像都是说SQLcomm未定义,请LZ帮忙解决一下,谢谢
2。打开blogcomm.asp,找到复制内容到剪贴板代码:
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)由于之前我做了某些修改,也提供过修改方法,可能部分朋友已经修改过,所以这里用到了一个之前用的已经定义了的变量。请先搜索下是否有SQLcomm,log_commcomm,如有就OK,如没有,先插入一行dim SQLcomm,log_commcomm,谢谢yangjun.cn指正。
Conn.ExeCute("update blog_Content set log_CommNums=log_CommNums+1 where log_ID="&post_logID)由于之前我做了某些修改,也提供过修改方法,可能部分朋友已经修改过,所以这里用到了一个之前用的已经定义了的变量。请先搜索下是否有SQLcomm,log_commcomm,如有就OK,如没有,先插入一行dim SQLcomm,log_commcomm,谢谢yangjun.cn指正。
修改完以后,发表评论时的错误提示:
复制内容到剪贴板代码:
错误类型:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQLcomm'
/blogcomm.asp, 第 229 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON 2.0)
网页:
POST 153 ??? /blogcomm.asp
POST Data:
username=xuting&Message=%E5%93%88%E5%93%88%E3%80%82%E3%80%82%E3%80%82%E3%80%82%E3%80%82&logID=34&action=post&submit2=%E5%8F%91%E8%A1%A8%E8%AF%84%E8%AE%BA
复制内容到剪贴板代码:
错误类型:
Microsoft VBScript runtime (0x800A01F4)
Variable is undefined: 'SQLcomm'
/blogcomm.asp, 第 229 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; MAXTHON 2.0)
网页:
POST 153 ??? /blogcomm.asp
POST Data:
username=xuting&Message=%E5%93%88%E5%93%88%E3%80%82%E3%80%82%E3%80%82%E3%80%82%E3%80%82&logID=34&action=post&submit2=%E5%8F%91%E8%A1%A8%E8%AF%84%E8%AE%BA
发表评论
上一篇
下一篇

文章来自:
Tags:
回复


最后一步
不过还是谢谢版版帮我改了一个文件
cache这个文件我是改了不知道多少次了
仍然都错
麻烦你了