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?