Indy TIdImap4.UIDRetrieve方法!
这是我的小代码:
curMessage:TIdMessage;
tidImap: TIdIMAP4;
...
tidImap.UIDRetrieve('123', curMessage);
效果很好!现在,当我尝试阅读
curMessage.Body
“Then”时,有时它是空的。我知道当消息 IsMsgSinglePartMime 为 False 时它是空的。所以我无法从 Body 属性读取消息的正文。
我搜索了 curMessage 的每个属性,但没有找到正文。更奇怪的是,当我保存 curMessage 时
curMessage.Savefile('...');
,我可以看到那里的所有正文。
我不想发出另一个请求来获取正文(例如 UIDRetrieveText(2)),因为我知道正文数据位于某处,我只是找不到它,或者 Savefile/SaveStream 是否向服务器发出一些内部请求?
提前谢谢你们了!
Here is my little code:
curMessage:TIdMessage;
tidImap: TIdIMAP4;
...
tidImap.UIDRetrieve('123', curMessage);
That works fine! Now when i try to read
curMessage.Body
Then it is empty sometimes. I've understand that it is empty when message IsMsgSinglePartMime is False. So then i can't read message's body from Body property.
I've searched in curMessage's every property, but nowhere could i found the body text. What makes it even more odd, is that when i save curMessage
curMessage.Savefile('...');
then i can see all the body there.
I don't want to make another request to fetch for the body (eg UIDRetrieveText(2)) because i understand that the body data is there somewhere, i just could not find it or is Savefile/SaveStream making some internal requests to server?
Thank you guys in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要检查
TIdMessage.MessageParts
。在 Indy 10 中,
TIdMessageParts
已移至其自己的单元中,因此您可能必须将IdMessageParts
添加到您的 use 子句中。You need to be checking
TIdMessage.MessageParts
.In Indy 10,
TIdMessageParts
has been moved into it's own unit, so you may have to addIdMessageParts
to your uses clause.