JScript Sample: jscript/email/viewmail.asp
   ASP Script
   Comments or Client-side Script
   HTML and Text

<%@ language=jscript%>
<html>
<head>
<title>View Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>

<body>
<p align="right"><a href="newmail.html">New mail</a></p>
<p align="right"><a href="email.asp">Go
Back</a></p>
<p align="center"><big><big>View Mail</big></big></p>

<%
var mysession
var FromAddress,ToAddress,CcAddress,BccAddress,SendDate,ReceivedDate,Subject
var Size,Flag,ContentType,Body
FromAddress = ""
ToAddress = ""
CcAddress = ""
BccAddress = ""
ReceivedDate = ""
SendDate = ""
Subject = ""
Size = ""
Flag = ""
ContentType = ""
Body = ""
var inmessages
inmessages = Session("inmessages")
Response.Write ("<p> Inbox message sum is: " + inmessages.Count)
var movemessages
movemessages = inmessages
var opt
opt = Request.Form("Trace")(1)
var inmess
if(Request.Form("Trace").Count == 0){
     inmess = movemessages.GetFirst()
}
else
switch(opt){
case "1":
     inmess = movemessages.GetFirst()
      break;
case "2":
     inmess = movemessages.GetPrevious()
      break;
case "3":
     inmess = movemessages.GetNext()
      break;
case "4":
     inmess = movemessages.GetLast()
      break;
}
if (inmess != null){
      FromAddress = inmess.Sender.Name //+ " " + inmess.Sender.Address
      for(i = 1;i<=inmess.Recipients.Count;i++){
      if (inmess.Recipients(i).Type == 1){
              ToAddress = ToAddress + inmess.Recipients(i).Address + " "
              }
      else{
      if (inmess.Recipients(i).Type == 2)
      CcAddress = CcAddress + inmess.Recipients(i).Address + " "
      else{
      if (inmess.Recipients(i).Type == 3)
      BccAddress = BccAddress + inmess.Recipients(i).Address + " "
      }
      }
      }
      SendDate = inmess.TimeSent
      Subject = inmess.Subject
      Size = inmess.Size
      Body = inmess.Text
}
%>

<hr>

<form method="post" name="email" action="viewmail.asp">
   <input type="hidden" name="Trace" value><table border="0" width="100%" height="184">
     <tr>
       <td width="100%" colspan="4" height="27"><div align="center"><center><p><input
       type="button" value=" | < " name="First" onclick="First_Click()"><input
       type="button" value=" < " name="Forward" onclick="Forward_Click()"><input
       type="button" value=" > " name="ToNext" onclick="ToNext_Click()"><input
       type="button" value=" >| " name="Last" onclick="Last_Click()"></td>
     </tr>
     <tr align="center">
       <td width="25%" height="25"><div align="right"><p><font face="Verdana, Arial, Tahoma">From:</font></td>
       <td width="25%" height="25"><font face="Verdana, Arial, Tahoma"><input name="FromAddress"
       value="
<%= FromAddress %>" size="20"></font></td>
       <td width="25%" height="25"><div align="right"><p><font face="Verdana, Arial, Tahoma">To:</font></td>
       <td width="25%" height="25"><font face="Verdana, Arial, Tahoma"><input name="ToAddress"
       value="
<%= ToAddress %>" size="20"></font></td>
     </tr>
     <tr align="center">
       <td width="25%" height="21"><div align="right"><p>CC :</td>
       <td width="25%" height="21"><input name="CcAddress" value="
<%= CcAddress %>" size="20"></td>
       <td width="25%" height="21"><div align="right"><p>BCC :</td>
       <td width="25%" height="21"><input name="BccAddress" value="
<%= BccAddress %>" size="20"></td>
     </tr>
     <tr align="center">
       <td width="25%" height="21"><div align="right"><p>SendDate :</td>
       <td width="25%" height="21"><input name="SendDate" value="
<%= SendDate %>" size="20"></td>
       <td width="25%" height="21"><div align="right"><p>Subject :</td>
       <td width="25%" height="21"><input name="Subject" value="
<%= Subject %>" size="20"></td>
     </tr>
     <tr align="center">
       <td width="25%" height="20"><div align="right"><p>Size :</td>
       <td width="25%" height="20"><input name="Size" value="
<%= Size %>" size="20"></td>
       <td width="25%" height="20"><div align="right"><p>Attachment :</td>
     </tr>
     <tr align="left">
       <td width="100%" height="21" colspan="4">Body :</td>
     </tr>
     <tr align="left">
       <td width="100%" height="21" colspan="4"><textarea cols="68" rows="5">
<%= Body %>  </textarea><p> </td>
     </tr>
   </table>
</form>

<hr>

<p align="center"><u><em>@1998 by Halcyon Corporation. All rights
reserved</em></u></p>
</body>

<SCRIPT  Language = "JScript">
function First_Click()
{
email.Trace.value = 1;
email.submit();
}
function Forward_Click()
{
email.Trace.value = 2;
email.submit();
}
function ToNext_Click()
{
email.Trace.value = 3;
email.submit();
}
function Last_Click()
{
email.Trace.value = 4;
email.submit();
}
</SCRIPT>

</html>


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.