c# pop 邮件删除问题

暮_雪 2013-01-05 02:50:28
OpenPop.Pop3.Exceptions.PopServerException: The server did not respond with a + response. The response was: "-ERR already deleted (eyou mta)" 在 OpenPop.Pop3.Pop3Client.IsOkResponse(String response) 在 OpenPop.Pop3.Pop3Client.SendCommand(String command) 在 OpenPop.Pop3.Pop3Client.DeleteMessage(Int32 messageNumber)

foreach (SelectedRow row in sm.SelectedRows)
{
int index = row.RowIndex;
client.DeleteMessage(index + 1);
}
...全文
587 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
暮_雪 2013-01-06
  • 打赏
  • 举报
回复
我知道了,是没有清理之前选保存时留下的记录
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
高手,神人。。。。
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
????有代码吗?
真相重于对错 2013-01-05
  • 打赏
  • 举报
回复
for(.....) { pop3.delete(0) }
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
应该不是,我只是先把邮件保存到数据库里,然后再将它从服务器上删除,这样才会报错,其他情况像直接删除是不会出错的
gxingmin 2013-01-05
  • 打赏
  • 举报
回复
说明你重复删同一个邮件了,你再看看是不是Index用的不对
gxingmin 2013-01-05
  • 打赏
  • 举报
回复
ERR already deleted (eyou mta)".... 这个错误是说邮件已经删除了...
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
我是先保存,然后就删除,才会出这个错误的,其他的情况都不会出这个问题
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
OpenPop.Pop3.Exceptions.PopServerException: The server did not respond with a + response. The response was: "-ERR already deleted (eyou mta)" 在 OpenPop.Pop3.Pop3Client.IsOkResponse(String response) 在 OpenPop.Pop3.Pop3Client.SendCommand(String command) 在 OpenPop.Pop3.Pop3Client.DeleteMessage(Int32 messageNumber)
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
我用你的方法,还是不行
gxingmin 2013-01-05
  • 打赏
  • 举报
回复
引用 3 楼 mu_xue 的回复:
那具体要怎样写这个方法呢? <SelectionModel> <ext:CheckboxSelectionModel ID="check" runat="server" /> </SelectionModel> 我是用Checkbox的,选中的就删除
晕,上面不是给出代码了吗,参看红色部分和红色部分下一行代码
暮_雪 2013-01-05
  • 打赏
  • 举报
回复
那具体要怎样写这个方法呢? <SelectionModel> <ext:CheckboxSelectionModel ID="check" runat="server" /> </SelectionModel> 我是用Checkbox的,选中的就删除
hangar_hyq 2013-01-05
  • 打赏
  • 举报
回复
引用 1 楼 gxingmin 的回复:
//集合删除要从后往前删,你从前往后删会改变集合的索引位置,所以会出错 for(int i= sm.SelectedRows.Count-1;i>=0;i--) { SelectedRow row = sm.SelectedRows[i]; int index = row.RowIndex; client.DeleteMessage(……
gxingmin 2013-01-05
  • 打赏
  • 举报
回复
//集合删除要从后往前删,你从前往后删会改变集合的索引位置,所以会出错 for(int i= sm.SelectedRows.Count-1;i>=0;i--) { SelectedRow row = sm.SelectedRows[i]; int index = row.RowIndex; client.DeleteMessage(index + 1); }

111,075

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧