<% EmailId = Request.QueryString("EmailId") RangeLo = Request.QueryString("RangeLo") RangeHi = Request.QueryString("RangeHi") Response.Write("") if (Session("UserId")<>"admin") then Response.Write("") End If %>

<% 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("

") End If Response.Write("") Response.Write("") Response.Write("") Response.Write("") %>

" + "

From:" + MailFrom + "
To:" + MailTo + "
Subject:" + Subject + "
DateTime:" + DateTime + "
<% 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, "") if (Pos=0) then ' was not found so search for Pos = InStr(EmailMsg, "") ' Response.Write("Searched for BODY
") End If if (Pos=0) then ' was not found so search for Pos = InStr(EmailMsg, "") EndPos = InStr(EmailMsg, "") ' Response.Write("Searched for HTML
") End If if (Pos=0) then ' was not found so search for Pos = InStr(EmailMsg, "") EndPos = InStr(EmailMsg, "") ' Response.Write("Searched for html
") End If if (Pos>0) then ' Response.Write(CStr(Pos)+"=Pos
") ' Response.Write(CStr(EndPos)+"=EndPos
") 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
") EmailMsg = Replace (EmailMsg, EOLN, "
") 'now find the first blank line. This is the end of the header and the beginning of the message. Start = InStr(EmailMsg, "

") if (Start>0) then EmailMsg = Mid(EmailMsg, Start) End If End If Response.Write(EmailMsg) SpamCrusher.Logoff() Response.Write("") %>