简体   繁体   English

如何使用openpop .net检索每个邮件附件的大小

[英]How to retrieve size of each attachment of mail using openpop .net

I use openpop .net library to retrieve mails from mail server with POP3. 我使用openpop .net库从带有POP3的邮件服务器中检索邮件。 All works fine but I can't retrieve size of each attachment of mail. 一切正常,但我无法获取每个邮件附件的大小。 I founded GetMessageSize(i) but this size is sum of all attachments. 我创建了GetMessageSize(i),但是这个大小是所有附件的总和。

Then the question is how I can retrieve size of each attachment. 然后的问题是我如何获取每个附件的大小。

Can anybody help me? 有谁能够帮助我? Thanks! 谢谢!

Use attachment.Body . 使用attachment.Body

foreach(var attachment in message.FindAllAttachments())
{
    long byteSize = attachment.Body.Length;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM