How to check amount of sent/received data in MailKit?

匆匆过客 提交于 2019-12-24 06:49:35

问题


I have a program in which I'm sending and receiving e-mails with large attachments. I'm using MailKit. I would like to get actual upload speed (or amount of already sent data) for each email.

How can I get this?


回答1:


There's no way to get 100% accurate upload/downloads speeds in MailKit, but MailKit does have APIs that take an ITransferProgress argument, such as the send method:

http://www.mimekit.org/docs/html/Overload_MailKit_MailTransport_Send.htm

You can implement your own ITransferProgress class that tracks transfer of data such as messages which should give you a rough idea.

This will allow you to get notifications of how much data has been uploaded (or downloaded when used with the various ImapFolder and/or Pop3Client methods), and, based on that + overall time spent, you can calculate transfer speeds.



来源:https://stackoverflow.com/questions/39120220/how-to-check-amount-of-sent-received-data-in-mailkit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!