[英]How to get the Outlook mail item's size?
'm writing an Outlook Add-in for Outlook 2007. This is a VSTO 3.0 , C# add-in. 正在为Outlook 2007编写Outlook加载项。这是VSTO 3.0 C#加载项。 I capture the send event in the add-in and then check some of the Email properties (Which is being sent out) and based on that display some alert.
我在加载项中捕获发送事件,然后检查一些电子邮件属性(正在发送的)以及基于该显示的一些警报。
When I try to get the total size of email using mailItem.Size, it always returns 0 while the actual size of email is not 0. And if I save the email (mailitem.Save()) then mailItem.Size returns the correct size of the mail. 当我尝试使用mailItem.Size获取电子邮件的总大小时,它总是返回0,而电子邮件的实际大小不为0。如果我保存电子邮件(mailitem.Save()),则mailItem.Size返回正确的大小。的邮件。 Does any one know about reason behind this behavior .
有没有人知道这种行为背后的原因。 Is there any otherway to get the email size ?
还有其他方法可以获取电子邮件大小吗?
yes, this is the default behavior in Outlook. 是的,这是Outlook中的默认行为。
I suggest you save it ( MailItem.Save
) before you send it. 我建议你在发送之前保存它(
MailItem.Save
)。
Saving the email will place it in the drafts folder...but who cares because you will now check its size ( MailItem.Size
) and send it ( MailItem.Send
). 保存电子邮件会将其放在草稿文件夹中...但是谁在乎,因为您现在将检查其大小(
MailItem.Size
)并发送它( MailItem.Send
)。
Does any one know about reason behind this behavior .
有没有人知道这种行为背后的原因。 Is there any otherway to get the email size ?
还有其他方法可以获取电子邮件大小吗?
AFAIK, This is the default behavior in Outlook. AFAIK,这是Outlook中的默认行为。 You cannot get the size till the time you save/send it.
在保存/发送之前,您无法获取大小。
You can however check for the Attachment size or the Body Length if that helps? 但是,如果有帮助,您可以检查附件大小或身体长度?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.