How to save email attachment using OpenPop

前端 未结 7 944
渐次进展
渐次进展 2020-12-30 09:29

I have created a Web Email Application, How do I view and save attached files?

I am using OpenPop, a third Party d

7条回答
  •  庸人自扰
    2020-12-30 10:09

        private KeyValuePair parse(MessagePart part)
        {
            var _steam = new MemoryStream();
            part.Save(_steam);
            //...
            var _info = new FileInfo(part.FileName);
            return new KeyValuePair(_steam.ToArray(), _info);
        }
    
        //... How to use
        var _attachments = message 
            .FindAllAttachments()
            .Select(a => parse(a))
        ;
    

提交回复
热议问题