贡献我全部积分了,这个问题烦了我几天,就是用jmail去收取邮件,还没进行存入数据库操作,能不能按邮件的接收时间进行排序呢?还有个问题,就是我在写入数据库,邮件有乱码就提示数据库插入失败。。下面这个是由邮件服务器读取邮件的列表,但是没按排序,很乱
我目的是实现邮件收取时间的排序 <TABLE border=0 cellPadding=0 cellSpacing=2 width="95%">
<TBODY>
<TR align=middle class=t_dark>
<TD height=20 noWrap width="5%">选择 </TD>
<TD width="5%">类型 </TD>
<TD width="5%">附件 </TD>
<TD width="23%">发件人 </TD>
<TD width="35%">主题 </TD>
<TD width="17%"> <A class=a_w
>▲ </A>
日期 <A class=a_w
>▼ </A> </TD>
<!--
<TD noWrap width="10%">邮件大小 </TD> //-->
</TR>
<FORM action="" method=post name=shiftdel> <INPUT
name=Sour_Folder type=hidden value=aW5ib3g*> <INPUT name=userid type=hidden
value=291926> <INPUT name=idnumber type=hidden
value=MjAwMjAxMTgxNDU2MjcxMTA2TVFrUEJ> <INPUT name=msgCount type=hidden value= <%=msgCount%>>
<INPUT name=pagestart type=hidden value=1> <INPUT name=pageend type=hidden
value=15>
<%
var i;
if (pop.Count > 0)
{
for (i=msgEndID;i>=msgBeginID;i--)
{
var msg;
msg = Server.CreateObject("JMail.Message");
msg = pop.Messages.Item(i);
var vdt = new Date(msg.Date);
var vMonth,vDay,vHours,vMinutes,vSeconds;
if (vdt.getMonth()+1 < 10)
vMonth = "0" + String(vdt.getMonth());
else
vMonth = String(vdt.getMonth());
if (vdt.getDate() < 10)
vDay = "0" + String(vdt.getDate());
else
vDay = String(vdt.getDate());
if (vdt.getHours() < 10)
vHours = "0" + String(vdt.getHours());
else
vHours = String(vdt.getHours());
if (vdt.getMinutes() < 10)
vMinutes = "0" + String(vdt.getMinutes());
else
vMinutes = String(vdt.getMinutes());
if (vdt.getSeconds() < 10)
vSeconds = "0" + String(vdt.getSeconds());
else
vSeconds = String(vdt.getSeconds());
vdt = vdt.getFullYear()
+ "-" + vMonth
+ "-" + vDay
+ " " + vHours
+ ":" + vMinutes
+ ":" + vSeconds;
var vFrom;
if (msg.FromName != "")
vFrom = msg.FromName;
else
vFrom = msg.From;
var vPriorityImg = "";
if (msg.Priority <= 1)
vPriorityImg = " <IMG src=\"Inbox/newmail_h.gif\">";
else if (msg.Priority >= 5)
vPriorityImg = " <IMG src=\"Inbox/low.gif\">";
else
vPriorityImg = "";
if (i % 2 == 0)
Response.Write(" <TR class=gray>");
else
Response.Write(" <TR class=whitesmoke>"); Response.Write(" <TD align=left width=\"3%\">");
Response.Write(" <INPUT name=index" + (msgEndID-i+1) +" onclick=selectbox() type=checkbox value=" + i + ">");
Response.Write(" </TD>");
Response.Write(" <TD align=left width=\"5%\"> <B> <IMG src=\"Inbox/mail.gif\">"+vPriorityImg+" </B> </TD>");
Response.Write(" <TD align=middle width=\"5%\"> <B>");
if (msg.Attachments.Count > 0)
Response.Write(" <IMG src=\"Inbox/clip.gif\">");
Response.Write(" </B> </TD>");
Response.Write(" <TD align=left> <A href=\"readmail.asp?messageindex="+i+"\">" + vFrom + " </A> </TD>");
Response.Write(" <TD align=left> <A href=\"readmail.asp?messageindex="+i+"\">" + msg.Subject + " </A> </TD>");
Response.Write(" <TD align=left>" + vdt + " </TD>");
//Response.Write(" <TD align=middle>" + String(Math.round(msg.Size/1000)) + "K </TD>");
//Response.Write(" <TD align=middle>" + "" + " </TD>");
Response.Write(" </TR> <INPUT name=fileid"+(msgEndNo-i+1)+" type=hidden value=" + i +">");
}
}
%>
我目的是实现邮件收取时间的排序 <TABLE border=0 cellPadding=0 cellSpacing=2 width="95%">
<TBODY>
<TR align=middle class=t_dark>
<TD height=20 noWrap width="5%">选择 </TD>
<TD width="5%">类型 </TD>
<TD width="5%">附件 </TD>
<TD width="23%">发件人 </TD>
<TD width="35%">主题 </TD>
<TD width="17%"> <A class=a_w
>▲ </A>
日期 <A class=a_w
>▼ </A> </TD>
<!--
<TD noWrap width="10%">邮件大小 </TD> //-->
</TR>
<FORM action="" method=post name=shiftdel> <INPUT
name=Sour_Folder type=hidden value=aW5ib3g*> <INPUT name=userid type=hidden
value=291926> <INPUT name=idnumber type=hidden
value=MjAwMjAxMTgxNDU2MjcxMTA2TVFrUEJ> <INPUT name=msgCount type=hidden value= <%=msgCount%>>
<INPUT name=pagestart type=hidden value=1> <INPUT name=pageend type=hidden
value=15>
<%
var i;
if (pop.Count > 0)
{
for (i=msgEndID;i>=msgBeginID;i--)
{
var msg;
msg = Server.CreateObject("JMail.Message");
msg = pop.Messages.Item(i);
var vdt = new Date(msg.Date);
var vMonth,vDay,vHours,vMinutes,vSeconds;
if (vdt.getMonth()+1 < 10)
vMonth = "0" + String(vdt.getMonth());
else
vMonth = String(vdt.getMonth());
if (vdt.getDate() < 10)
vDay = "0" + String(vdt.getDate());
else
vDay = String(vdt.getDate());
if (vdt.getHours() < 10)
vHours = "0" + String(vdt.getHours());
else
vHours = String(vdt.getHours());
if (vdt.getMinutes() < 10)
vMinutes = "0" + String(vdt.getMinutes());
else
vMinutes = String(vdt.getMinutes());
if (vdt.getSeconds() < 10)
vSeconds = "0" + String(vdt.getSeconds());
else
vSeconds = String(vdt.getSeconds());
vdt = vdt.getFullYear()
+ "-" + vMonth
+ "-" + vDay
+ " " + vHours
+ ":" + vMinutes
+ ":" + vSeconds;
var vFrom;
if (msg.FromName != "")
vFrom = msg.FromName;
else
vFrom = msg.From;
var vPriorityImg = "";
if (msg.Priority <= 1)
vPriorityImg = " <IMG src=\"Inbox/newmail_h.gif\">";
else if (msg.Priority >= 5)
vPriorityImg = " <IMG src=\"Inbox/low.gif\">";
else
vPriorityImg = "";
if (i % 2 == 0)
Response.Write(" <TR class=gray>");
else
Response.Write(" <TR class=whitesmoke>"); Response.Write(" <TD align=left width=\"3%\">");
Response.Write(" <INPUT name=index" + (msgEndID-i+1) +" onclick=selectbox() type=checkbox value=" + i + ">");
Response.Write(" </TD>");
Response.Write(" <TD align=left width=\"5%\"> <B> <IMG src=\"Inbox/mail.gif\">"+vPriorityImg+" </B> </TD>");
Response.Write(" <TD align=middle width=\"5%\"> <B>");
if (msg.Attachments.Count > 0)
Response.Write(" <IMG src=\"Inbox/clip.gif\">");
Response.Write(" </B> </TD>");
Response.Write(" <TD align=left> <A href=\"readmail.asp?messageindex="+i+"\">" + vFrom + " </A> </TD>");
Response.Write(" <TD align=left> <A href=\"readmail.asp?messageindex="+i+"\">" + msg.Subject + " </A> </TD>");
Response.Write(" <TD align=left>" + vdt + " </TD>");
//Response.Write(" <TD align=middle>" + String(Math.round(msg.Size/1000)) + "K </TD>");
//Response.Write(" <TD align=middle>" + "" + " </TD>");
Response.Write(" </TR> <INPUT name=fileid"+(msgEndNo-i+1)+" type=hidden value=" + i +">");
}
}
%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货