N
ngxfer001
Dear Experts,
Sorry to bother everyone, I have used httpclient to login my webmail
(squirrelmail) successfully, now I would like to flag unread for the
read email.
the procedure is as follows:
1) check the check box next to mail.
<td align="center" bgcolor="#ededed"><input name="msg[0]"
value="24446" type="checkbox"></td>
<td title="(e-mail address removed)" align="left"
bgcolor="#ededed"><b>"JBClub.net $B>>K\(B"</b></td>
<td align="center" bgcolor="#ededed" nowrap="nowrap"><b>10:11 pm</b></
td>
<td align="center" bgcolor="#ededed"
nowrap="nowrap"><b><small> </
small></b></td>
<td align="left" bgcolor="#ededed"><b><a href="read_body.php?
mailbox=INBOX&passed_id=24446&startMessage=1" title="Fw:
[AFL1530413*10000451] Mr. Kakuya Ide">Fw: [AFL1530413*10000451] Mr.
Kakuy...</a></b></td>
</tr>
<tr><td colspan="5" bgcolor="#dcdcdc" height="1"></td></tr>
<tr valign="top">
2) press the button to mark it unread. The button html code is as
follows.
<table border="0" width="100%" cellpadding="0"
cellspacing="0"><tr><td><form name="FormMsgsINBOX" method="post"
action="move_messages.php">
<input type="hidden" name="msg" value="">
<input type="hidden" name="mailbox" value="INBOX">
<input type="hidden" name="startMessage" value="1">
<table border="0" width="100%" cellpadding="1" cellspacing="0"><tr
bgcolor="#dcdcdc"><td align="left"><table bgcolor="#ffffff" border="0"
width="100%" cellpadding="1" cellspacing="0"><tr><td
align="left"><font color="#ababab">Previous</font> | <a
href="right_main.php?
use_mailbox_cache=0&startMessage=16&mailbox=INBOX" >Next</
a> | 1 <a href="right_main.php?
use_mailbox_cache=0&startMessage=16&mailbox=INBOX" >2</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=31&mailbox=INBOX" >3</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=46&mailbox=INBOX" >4</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=61&mailbox=INBOX" >5</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=76&mailbox=INBOX" >6</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=91&mailbox=INBOX" >7</
a> ... <a href="right_main.php?
use_mailbox_cache=0&startMessage=1711&mailbox=INBOX" >115</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1726&mailbox=INBOX" >116</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1741&mailbox=INBOX" >117</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1756&mailbox=INBOX" >118</
a> | <a href="right_main.php?
PG_SHOWALL=1&use_mailbox_cache=0&startMessage=1&mailbox=INBOX"
<!--
function CheckAllINBOX() {
for (var i = 0; i < document.FormMsgsINBOX.elements.length; i++) {
if(document.FormMsgsINBOX.elements.type == 'checkbox'){
document.FormMsgsINBOX.elements.checked = !
(document.FormMsgsINBOX.elements.checked);
}
}
}
//-->
</script><a href="javascript:void(0)"
onClick="CheckAllINBOX();">Toggle All</a>
</td>
<td align="right">Viewing Messages: <b>1</b> to <b>15</b> (1766
total)</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr><tr><td height="5" bgcolor="#ffffff"></td></tr><tr><td><tr>
<td align="left">
<table bgcolor="#ababab" border="0" width="100%" cellpadding="1"
cellspacing="0">
<tr><td><table bgcolor="#dcdcdc" border="0" width="100%"
cellpadding="1" cellspacing="0">
<tr><td align="left" nowrap><small>Move Selected To: </small></
td>
<td align="right" nowrap><small>Transform Selected Messages: </
small></td>
</tr>
<tr>
<td align="left" valign="middle" nowrap>
<small> <tt><select name="targetMailbox"><option
value="INBOX">INBOX</option>
<option value="INBOX.Drafts">INBOX.Drafts</option>
<option value="INBOX.Sent">INBOX.Sent</option>
<option value="INBOX.Trash">INBOX.Trash</option>
<option value="INBOX.Junk">INBOX.Junk</option>
</select></tt> <input type="SUBMIT" name="moveButton"
value="Move">
<input type="SUBMIT" name="attache" value="Forward">
</small></td>
<td align="right" nowrap="nowrap">
<input name="markRead" value="$B4{FI(B" type="submit"><input
name="markUnread" value="$BL$FI(B" type="submit"><input name="delete"
value="$B=|(B" type="submit">
<input name="location" value="/www.s188.xrea.com/mail/src/
right_main.php?&startMessage=1&mailbox=INBOX" type="hidden">
</td>
I have done the following:
PostMethod checkpost = new PostMethod(FRONT_PAGE +
"move_messages.php");
NameValuePair msg1 = new NameValuePair("msg[0]", "24446");
NameValuePair button = new NameValuePair("msg", "markUnread");
checkpost.setRequestBody(new NameValuePair[] {msg1, button});
client.executeMethod(checkpost);
System.out.println("Login form post: " +
checkpost.getStatusLine().toString());
This code doesn't seems to work, can you point me into the new
direction on how to do that?
thank you very much for helping me.
Best Regards
Ferdinand Ng
Sorry to bother everyone, I have used httpclient to login my webmail
(squirrelmail) successfully, now I would like to flag unread for the
read email.
the procedure is as follows:
1) check the check box next to mail.
<td align="center" bgcolor="#ededed"><input name="msg[0]"
value="24446" type="checkbox"></td>
<td title="(e-mail address removed)" align="left"
bgcolor="#ededed"><b>"JBClub.net $B>>K\(B"</b></td>
<td align="center" bgcolor="#ededed" nowrap="nowrap"><b>10:11 pm</b></
td>
<td align="center" bgcolor="#ededed"
nowrap="nowrap"><b><small> </
small></b></td>
<td align="left" bgcolor="#ededed"><b><a href="read_body.php?
mailbox=INBOX&passed_id=24446&startMessage=1" title="Fw:
[AFL1530413*10000451] Mr. Kakuya Ide">Fw: [AFL1530413*10000451] Mr.
Kakuy...</a></b></td>
</tr>
<tr><td colspan="5" bgcolor="#dcdcdc" height="1"></td></tr>
<tr valign="top">
2) press the button to mark it unread. The button html code is as
follows.
<table border="0" width="100%" cellpadding="0"
cellspacing="0"><tr><td><form name="FormMsgsINBOX" method="post"
action="move_messages.php">
<input type="hidden" name="msg" value="">
<input type="hidden" name="mailbox" value="INBOX">
<input type="hidden" name="startMessage" value="1">
<table border="0" width="100%" cellpadding="1" cellspacing="0"><tr
bgcolor="#dcdcdc"><td align="left"><table bgcolor="#ffffff" border="0"
width="100%" cellpadding="1" cellspacing="0"><tr><td
align="left"><font color="#ababab">Previous</font> | <a
href="right_main.php?
use_mailbox_cache=0&startMessage=16&mailbox=INBOX" >Next</
a> | 1 <a href="right_main.php?
use_mailbox_cache=0&startMessage=16&mailbox=INBOX" >2</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=31&mailbox=INBOX" >3</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=46&mailbox=INBOX" >4</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=61&mailbox=INBOX" >5</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=76&mailbox=INBOX" >6</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=91&mailbox=INBOX" >7</
a> ... <a href="right_main.php?
use_mailbox_cache=0&startMessage=1711&mailbox=INBOX" >115</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1726&mailbox=INBOX" >116</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1741&mailbox=INBOX" >117</
a> <a href="right_main.php?
use_mailbox_cache=0&startMessage=1756&mailbox=INBOX" >118</
a> | <a href="right_main.php?
PG_SHOWALL=1&use_mailbox_cache=0&startMessage=1&mailbox=INBOX"
javascript">Show All</a> | <script language="JavaScript" type="text/
<!--
function CheckAllINBOX() {
for (var i = 0; i < document.FormMsgsINBOX.elements.length; i++) {
if(document.FormMsgsINBOX.elements.type == 'checkbox'){
document.FormMsgsINBOX.elements.checked = !
(document.FormMsgsINBOX.elements.checked);
}
}
}
//-->
</script><a href="javascript:void(0)"
onClick="CheckAllINBOX();">Toggle All</a>
</td>
<td align="right">Viewing Messages: <b>1</b> to <b>15</b> (1766
total)</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr><tr><td height="5" bgcolor="#ffffff"></td></tr><tr><td><tr>
<td align="left">
<table bgcolor="#ababab" border="0" width="100%" cellpadding="1"
cellspacing="0">
<tr><td><table bgcolor="#dcdcdc" border="0" width="100%"
cellpadding="1" cellspacing="0">
<tr><td align="left" nowrap><small>Move Selected To: </small></
td>
<td align="right" nowrap><small>Transform Selected Messages: </
small></td>
</tr>
<tr>
<td align="left" valign="middle" nowrap>
<small> <tt><select name="targetMailbox"><option
value="INBOX">INBOX</option>
<option value="INBOX.Drafts">INBOX.Drafts</option>
<option value="INBOX.Sent">INBOX.Sent</option>
<option value="INBOX.Trash">INBOX.Trash</option>
<option value="INBOX.Junk">INBOX.Junk</option>
</select></tt> <input type="SUBMIT" name="moveButton"
value="Move">
<input type="SUBMIT" name="attache" value="Forward">
</small></td>
<td align="right" nowrap="nowrap">
<input name="markRead" value="$B4{FI(B" type="submit"><input
name="markUnread" value="$BL$FI(B" type="submit"><input name="delete"
value="$B=|(B" type="submit">
<input name="location" value="/www.s188.xrea.com/mail/src/
right_main.php?&startMessage=1&mailbox=INBOX" type="hidden">
</td>
I have done the following:
PostMethod checkpost = new PostMethod(FRONT_PAGE +
"move_messages.php");
NameValuePair msg1 = new NameValuePair("msg[0]", "24446");
NameValuePair button = new NameValuePair("msg", "markUnread");
checkpost.setRequestBody(new NameValuePair[] {msg1, button});
client.executeMethod(checkpost);
System.out.println("Login form post: " +
checkpost.getStatusLine().toString());
This code doesn't seems to work, can you point me into the new
direction on how to do that?
thank you very much for helping me.
Best Regards
Ferdinand Ng