exchange-server


How to get filesize and LastupdateTime from attachment in Exchange Server 2007 email account?


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.
You can't get these properties in EWS in Exchange 2007 the only way to get the size of an attachment would be to download the attachment. In 2007 you should still be able to use WebDAV https://msdn.microsoft.com/en-us/library/ms877930(v=exchg.65).aspx which you can get this information from without needing to do the download otherwise look at using MAPI via Outlook/Redemption.
Cheers
Glen

Related Links

Exchange web services API - Get all mailboxes
exchange server: how to check database of specific mailbox through exchange shell
Implementing Provision on Exchange ActiveSync client
How to Capture Meeting-Created Event in MS Exchange 2013
KQL Syntax using a variable - Exchange 2013
Detecting calendar-event mail items in Office365 REST Mail API
Exchange Server - Get CASMailbox - Parameters
Accessing all email on Exchange Server
Adding a user to a specific GAL in a multitenant exchange environment
EWS appointment time intervals
Facing issue in setting follow up for email
Get Complete User List in Microsoft Exchange
Exchange Managed API: Get Resources List of an appointment
Why exchange server return different serverIds in MoveItems and Sync
Integrating Exchange with website
EWS - pull autolist contacts from exchange

Categories

HOME
qt
matrix
automapper
verification
freeradius
shinyapps
concurrency
typeerror
semantic-web
cypher
facebook-android-sdk
sentry
static-analysis
jpa-criteria
log4j2
alljoyn
tiff
clish
squirrel-sql
jodatime
asp.net-core-1.0
async-await
robolectric
coreldraw
gollum-wiki
candlestick-chart
substring
points
marquee
bitbake
custom-keyboard
sbjson
utf
oauth2-playground
haar-classifier
elasticsearch-aggregation
qvtkwidget
.net-micro-framework
hibernate-ogm
pen
popen
emf-compare
http4s
wildfly-9
bpms
ogg
ftp-client
jenkins-workflow
codecharge
jeditable
accessibilityservice
outlook.com
roxygen2
algebraixlib
dbmigrate
gflags
mgwt
camus
tidyr
maven-shade-plugin
tkx
fasterxml
image-rotation
global-scope
iplimage
relationships
nidaqmx
webautomation
assetic
proxy-server
yii-booster
flv
notin
dojo-1.9
ckeditor.net
system-requirements
semantic-merge
nsmutablestring
popup-blocker
kolite
datacontracts
azure-acs
digiflow
downgrade
odac
getimagesize
xap
word-automation

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App