exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Downloading attachments, some progress...

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development
Author Message
Maury Markowitz



Joined: 14 Feb 2008
Posts: 12

PostPosted: Tue Feb 19, 2008 12:28 pm    Post subject: Downloading attachments, some progress... Reply with quote

Quick refresher: I'm being sent a number of files in e-mail which is directed
to a public folder. I need to extract the attachments once a day.

I have made some progress. I have figured out how to open the folder using
ODBC and made queries against the message list, picking out the correct
messages; ones received today from particular addresses. This, as expected,
returns a single message "row".

I am now trying to retrieve the attachment. I am going to try to use WebDAV
to get it, because that seems to be the only one that works on any of these
machines. Here is what I do...

rstEmails.Open "SELECT * FROM theTable WHERE [From] LIKE
'%@thesender.com' AND [Has Attachments]=True AND [Received]>=#" & date & "#
AND [Received]<#" & DateAdd("d", 1, date) & "#", conn, adOpenStatic,
adLockReadOnly

' use the subject to create an URI
Subject = Trim(rstEmails!Subject)
Subject = Replace(Subject, " ", "%20")
Uri = "http://x4.ourdomain.com/public/theFolder/" & Subject & ".eml"

Set req = CreateObject("microsoft.xmlhttp")
req.Open "X-MS-ENUMATTS", Uri, False

req.send
Set ret = req.responseXML

fname =
ret.getElementsByTagName("e:attachmentfilename")(0).FirstChild.Text

When I try this code against a test file that I sent to the folder,
everything works fine and I get the file back. However, when I try this
against a real message, I get nothing in
ret.getElementsByTagName("e:attachmentfilename"), and looking at the ret
object itself, I see that the childNodes is zero length, which I assume is
not correct. Yes, the test file and real file both have a file attachment --
which is why the WHERE works.

The only difference I can see is that the "Message.Class" for the message I
sent is "IPM.Note", whereas the real one came in as "IPM.Post". Would this
make a difference?

Maury

Archived from group: microsoft>public>exchange>development
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
WebDav Attachments issue! Hi there, I've been struggling for a while to send messages with attachement, it worked once but now I just get an operation time out error. I can send a normal mail easily but the attachment part is a different story. I authenticate using FBA and its an

Use transport agent to remove large attachments Hi, I have to develop an Exchange 2007 transpost agent that handles incoming emails as follows: If an email contains a large attachment, the agent should remove it and put a warning in the email body. This should be done BEFORE the email is written to the

Accessing attachments through ODBC? Any ODBC/Exchange gurus? I have created a public folder to act as a "drop box" for incoming messages that need to be readable by anyone in the company. Some of these messages are automated reports that are generated by 3rd parties. I'd like to access these files, preferably via O

Downloading attachments, how to do it Ok, it's working. Here's what you do. To start with, use to do a find and get the message that you want. If you want "all attachments" then just skip this step. However, you probably don't want "all attachments", because then you'll be r

Attachments not downloading to Windows Mobile 5 devices Weird issue... We've just completed our migration to Exchange 2007 SP1 from 2003 SP2. We have Windows Mobile 5 users who can't download attachments; however, those who have Windows Mobile 6 aren't having an issue. The default ActiveSync policy in Exchan
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group