Hmmm... that's why I hate psting stuff without testing.
The new code should be like this:
'######## Email Spam Mod ############
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute (strSql)
If Not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 5 then
Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
strSpammerName = RS("M_NAME")
rs.Close
strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID
set rs = my_Conn.Execute (strSql)
if rs.bof or rs.eof Then
strDestName = ""
Else
strDestname = rs("M_NAME")
End If
rs.close
Set rs = nothing
'Send email to forum admin
strRecipients = strSender
strFrom = strSender
strFromName = "Automatic Server Email"
strSubject = "Possible Spam Poster"
strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & strDestName & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine
strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end If
Else
rs.Close
Set rs = nothing
End If
end if
'############# End of email spam mod #############
ruirib, thank you very much sir, this mod is exactly what i was looking for. im so tired of these one-hit monkeys joining my board and emailing all my members only to get 100 posts (on the concealedcarryforum.com particularly) on the spam mails the members were getting. thanks again!<
I hope I'm not stepping on any toes here. I received an email from this mod (which is working great BTW) and decided that the text version of the message did nothing for me, being that I have my forums setup to send me HTML emails. So, I went through and started formatting the text, then decided to add a few features to the message.
In this mod variation for HTML emails, I have only modifed the information starting on, or about, line #46 in the pop_mail.asp file.
New features:
Offender visible from Subject line
Increased legibility of all data
Link to offender's profile
Link to WHOIS information for offender's IP Address
Server Time
Offender's RAW Data
Link back to this thread so admins like me remember where to find info on it
'######## Email Spam Mod ############
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
strSql = "SELECT M_NAME, M_EMAIL, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute (strSql)
If Not rs.EOF then
intMPosts = rs("M_POSTS")
intRID = Request.Querystring("id")
strSQL_x = "SELECT M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
strSql_x = strSql_x & " WHERE M.MEMBER_ID = " & intRID
set rs_x = my_Conn.Execute (strSql_x)
If Not rs_x.EOF then
R_Name = rs_x("M_NAME")
end if
rs_x.close
if intMPosts < 10 then
Err_Msg = "<li>You need more than " & intMPosts & " posts to send emails to other members. If you want to get someone's attention please just post it, we will not neglect you.</li>"
strSpammerName = RS("M_NAME")
'Send email to forum admin
strRecipients = strSender
strFrom = strSender
strFromName = "Automatic Server Email"
strSubject = "Possible Spam Poster [" & strSpammerName & "]"
strMessage = "<font style=""font-family: arial;"">" & vbNewLine & vbNewLine
strMessage = strMessage & "There is a possible spam poster at " & strForumTitle & "<br />" & vbNewLine & vbNewLine
strMessage = strMessage & "Member: <a href=""/forums/pop_profile.asp?mode=display&id=" & MemberID & """><b>" & strSpammerName & "(Member ID " & MemberID & ")</b></a><br />" & vbNewLine
strMessage = strMessage & " # of Posts: <b>" & intMPosts & "</b><br />" & vbNewLine
strMessage = strMessage & "Intended Recipient: <b>" & R_Name & "(Member #" & intRID & ")</b><br />" & vbNewLine
strMessage = strMessage & "Message: <br/><b>" & VbNewLine & replace(Request.Form("Msg"), vbNewLine, "<br />") & "</b><br />" & vbNewLine
strMessage = strMessage & "<hr /><br />" & vbNewLine
strMessage = strMessage & "Remote Address WHOIS: <a href=""http://whois.domaintools.com/" & Request.ServerVariables("remote_addr") & """>" & Request.ServerVariables("remote_addr") & "</a><br />" & vbNewLine
strMessage = strMessage & "Server Time - (1/24): <b>" & Now()-(1/24) & "</b><br/>" & vbNewline
strMessage = strMessage & "RAW DATA: <b>" & Request.ServerVariables("ALL_RAW") & "</b><br />" & vbNewline
strMessage = strMessage & "<hr /><br />" & vbNewLine
strMessage = strMessage & "This is a message sent automatically by the <a href=""http://forum.snitz.com/forum/topic.asp?TOPIC_ID=62640"">Spam Control Mod</a>."
strMessage = strMessage & "</font>"
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end If
End if
rs.Close
end if
'############# End of email spam mod #############
<
Robert Williams Join the fight against braindumps!
Hmmm... that's why I hate psting stuff without testing.
The new code should be like this:
'######## Email Spam Mod ############
if Request.QueryString("mode") = "DoIt" then
Err_Msg = ""
strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID
set rs = my_Conn.Execute (strSql)
If Not rs.EOF then
intMPosts = rs("M_POSTS")
if intMPosts < 5 then
Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
strSpammerName = RS("M_NAME")
rs.Close
strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID
set rs = my_Conn.Execute (strSql)
if rs.bof or rs.eof Then
strDestName = ""
Else
strDestname = rs("M_NAME")
End If
rs.close
Set rs = nothing
'Send email to forum admin
strRecipients = strSender
strFrom = strSender
strFromName = "Automatic Server Email"
strSubject = "Possible Spam Poster"
strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & strDestName & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine
strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end If
Else
rs.Close
Set rs = nothing
End If
end if
'############# End of email spam mod #############
okay I've done all of this... and it still lets the spam email go through to the member and it doesn't send a note to the spammer... any advise?<
Excellent MOD! I just had a new member sign up today and start sending spam pm's to several of my members. I added the code for the email and the pm and it works great! Thanks!