delphi - 有没有办法知道 IMAP4 服务器的已发送电子邮件的文件夹名称?
问题描述
在我的 Delphi 10 应用程序中,我使用 tidIMAP4 使用此(部分)代码检索电子邮件
with IMAP4 do begin
case kind of
1 : MsgBox := 'INBOX';
10 : MsgBox := '[Gmail]/Sent Mail';//for GMail
2 : MsgBox := '[Gmail]/Bin/Deleted Items';//for GMail
3 : MsgBox := '[Gmail]/Spam';//for GMail
end;
SelectMailBox(MsgBox);
SetLength(SearchInfo, 1);
SearchInfo[0].Date := date-1;
SearchInfo[0].SearchKey := skSince;
if SearchMailBox(SearchInfo)
and (High(MailBox.SearchResult) > -1) then
try
msgs := High(MailBox.SearchResult)+1;
.....
我可以使用此代码找到服务器的邮箱
var st : TstringList := TstringList.Create;
IMAP4.ListMailBoxes(st);
showmessage(st.Text);
st.Free;
SelectMailBox(MsgBox)
因此,当我先验地知道 IMAP4 服务器时,我可以知道必须放入函数中的文件夹名称。
但我想要一种一致的方式来了解每个服务器(雅虎、用户服务器等)
类似SelectMailBox('deleted')
或类似的东西。这可能吗 ?
解决方案
推荐阅读
- sql-server - 自定义列的复制冲突检测
- ios - 您的凭据不允许访问此资源 Twitter API 错误
- r - 如何计算子矩阵之间的相关性?
- rest - “在这种情况下,资源将永远不可用”的状态代码
- javascript - 如何找到函数并将其添加到id?
- angular - 使用 Azure Active Directory 保护 Node API 的最佳实践
- java - Java ScheduledExecutorService.scheduleWithFixedDelay 启动新线程来执行任务而不等待第一个任务完成
- c++ - 从不同的文件夹加载具有相同依赖 DLL 的相同 DLL
- amazon-web-services - 如果第一个原点返回错误,请使用下一个原点
- php - 带有while循环的“遇到的格式不正确的数值”