home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.americansys.com
/
2014.06.ftp.americansys.com.tar
/
ftp.americansys.com
/
spamcrusherenterprise.exe
/
web
/
viewemail.asp
< prev
next >
Wrap
Text File
|
2004-05-28
|
5KB
|
170 lines
<html>
<head>
<title>Spam Crusher - View Email</title>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<!--#include FILE="header.asp"-->
<!--#include FILE="timeout.asp"-->
<p align="center">
<%
EmailId = Request.QueryString("EmailId")
RangeLo = Request.QueryString("RangeLo")
RangeHi = Request.QueryString("RangeHi")
Response.Write("<a href =""delete.asp?EmailId=" + EmailId + "&RangeLo=" + RangeLo + "&RangeHi=" + RangeHi +"""><img border=""0"" src=""delete.gif""></a>")
if (Session("UserId")<>"admin") then
Response.Write("<a href =""salvage.asp?EmailId=" + EmailId + "&RangeLo=" + RangeLo + "&RangeHi=" + RangeHi +"""><img border=""0"" src=""salvage.gif""></a>")
End If
%>
</p>
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" bgColor="navy" border="0">
<TR>
<TD>
<table>
<p>
<%
EOLN = chr(13) + chr(10)
EmailMsg = ""
Set SpamCrusher = Server.CreateObject("SpamCrusherEnterprise.SpamCrusherEnte.1")
SpamCrusher.SetCurrentUser(Session("UserId"))
Header = SpamCrusher.GetHeaderByMsgId(EmailId)
StartPos=1
Length = Left(Header, 3)
MailFrom = Mid(Header, StartPos+3, Length)
if (Len(MailFrom)>30) then
MailFrom = Left(MailFrom, 30) + "..."
End If
StartPos = Length+4
Header = Mid(Header, StartPos)
StartPos=1
Length = Left(Header, 3)
MailTo = Mid(Header, StartPos+3, Length)
StartPos = Length+4
Header = Mid(Header, StartPos)
StartPos=1
Length = Left(Header, 3)
Subject = Mid(Header, StartPos+3, Length)
Subject = Trim(Subject)
if (Length=0) then
Subject = "(no subject)"
End If
StartPos = Length+4
Header = Mid(Header, StartPos)
StartPos=1
Length = Left(Header, 3)
MailID = Mid(Header, StartPos+3, Length)
StartPos = Length+4
Header = Mid(Header, StartPos)
StartPos=1
Length = Left(Header, 3)
DateTime = Mid(Header, StartPos+3, Length)
Friends = SpamCrusher.GetFriendsList()
if (InStr(Friends, MailFrom)=0) then
'show the "add to my friends" button
Response.Write("<tr><td><p align=""center""><a href =""add2friends.asp?Friend=" + MailFrom + "&EmailId=" + EmailId + "&RangeLo=" + RangeLo + "&RangeHi=" + RangeHi +"""><img border=""0"" src=""add2friends.gif""></a>" + "</p></td></tr>")
End If
Response.Write("<tr><td><small><font color=""#FFFFFF""><b>From:</b></small></font></td><td><small><font color=""#FFFFFF"">" + MailFrom + "</small></font></td></tr>")
Response.Write("<tr><td><small><font color=""#FFFFFF""><b>To:</b></small></font></td><td><small><font color=""#FFFFFF"">" + MailTo + "</small></font></td></tr>")
Response.Write("<tr><td><small><font color=""#FFFFFF""><b>Subject:</b></small></font></td><td><small><font color=""#FFFFFF"">" + Subject + "</small></font></td></tr>")
Response.Write("<tr><td><small><font color=""#FFFFFF""><b>DateTime:</b></small></font></td><td><small><font color=""#FFFFFF"">" + DateTime + "</small></font></td></tr>")
%>
</p>
</table>
</SMALL></FONT>
</TD>
</TR>
<TR>
<TD bgColor="white">
<%
EmailMsg = SpamCrusher.GetMsg(EmailId)
EmailMsg = Replace (EmailMsg, "=3D", chr(61))
EmailMsg = Replace (EmailMsg, "=A0", chr(160))
EmailMsg = Replace (EmailMsg, "=95", chr(149))
EmailMsg = Replace (EmailMsg, "=92", chr(146))
EmailMsg = Replace (EmailMsg, "=20", chr(32))
EmailMsg = Replace (EmailMsg, "=0A", chr(10))
EmailMsg = Replace (EmailMsg, "=0D", chr(13))
EmailMsg = Replace (EmailMsg, "=09", chr(9))
EmailMsg = Replace (EmailMsg, "=" + EOLN, "")
'now parse out the junk we don't want. Start by looking to see if the email is HTML or not
Pos = InStr(EmailMsg, "<body")
EndPos = InStr(EmailMsg, "</body>")
if (Pos=0) then
' <body> was not found so search for <BODY>
Pos = InStr(EmailMsg, "<BODY")
EndPos = InStr(EmailMsg, "</BODY>")
' Response.Write("Searched for BODY<br>")
End If
if (Pos=0) then
' <BODY> was not found so search for <html>
Pos = InStr(EmailMsg, "<HTML>")
EndPos = InStr(EmailMsg, "</HTML>")
' Response.Write("Searched for HTML<br>")
End If
if (Pos=0) then
' <html> was not found so search for <HTML>
Pos = InStr(EmailMsg, "<html>")
EndPos = InStr(EmailMsg, "</html>")
' Response.Write("Searched for html<br>")
End If
if (Pos>0) then
' Response.Write(CStr(Pos)+"=Pos<br>")
' Response.Write(CStr(EndPos)+"=EndPos<br>")
EndPos = EndPos + 7
' HTML was found so display it as HTML
Length = EndPos-Pos
if (Length>1) then
EmailMsg = Mid(EmailMsg, Pos, Length)
Else
EmailMsg = Mid(EmailMsg, Pos)
End IF
Else
' HTML was NOT found so parse out the headers and only display the text
' Response.Write("TEXT ONLY<br>")
EmailMsg = Replace (EmailMsg, EOLN, "<br>")
'now find the first blank line. This is the end of the header and the beginning of the message.
Start = InStr(EmailMsg, "<br><br>")
if (Start>0) then
EmailMsg = Mid(EmailMsg, Start)
End If
End If
Response.Write(EmailMsg)
SpamCrusher.Logoff()
Response.Write("")
%>
</TD>
</TR>
<TR>
<TD></TD>
</TR>
</TABLE>
</P>
</body>
</html>