Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
How to get filesize from attachment in Exchange 2007?
NJ Bhanushali
Aug 21 2015 12:32 AM
317
Reply
Hello,
if (email.HasAttachments)
{
AttachmentList AttachmentFiles = new AttachmentList(); //class for attachment list
foreach (Attachment attachment in email.Attachments)
{
if (attachment is FileAttachment)
{
FileAttachment fileAttachment = attachment as FileAttachment;
attachmentEntity.MailID = MailID;
attachmentEntity.Filename = fileAttachment.FileName;
attachmentEntity.FileSize = fileAttachment.Size;
attachmentEntity.File = fileAttachment.Content;
attachmentEntity.CreatedDate = fileAttachment.LastModifiedTime;
AttachmentFiles.Add(attachmentEntity);
}
}
}
I got following error. The property Last Modified Time and Size are valid only for Exchange Exchange 2010 or later versions.
How to get filesize and LastupdateTime from attachment in Exchange Server 2007 email account?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
when i try to make a report the app crash
Creating Chart Programmatically