473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

WebDAV to access attached emails

Hi,

Within WebDAV I can use "X-MS-ENUMATTS" and "attachmentfilename" to get
attachment file names. But if the attachment is another email, it doesn't
come with "attachmentfilename".

My question is for attached emails, can I still use "X-MS-ENUMATTS" to get
them? using which property (similar to "attachmentfilename" for attached
files)?
Thanks in advance.

Li

Jul 21 '05 #1
4 3136
Hi Li,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

PS: microsoft.public.exchange.development is a better newsgroup for you to
ask WebDAV questions. More experienced people will reply to your questions
in that newsgroup. Thanks

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Li,

I noticed that an MVP Glen Scales has replied to you in anothor thread in
icrosoft.public.exchange2000.development. For convenience, I paste his
reply here. If you are still having questions, please reply to the post,
and I will find more resources for you. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
You should be able to use the CN which should be there wether its a normal
attachment or an embedded message. You might also want to look at using the
PR_ATTACH_METHOD (http://schemas.microsoft.com/mapi/proptag/x37050003) this
will tell you what type of attachment you are dealing with eg for a normal
attachment this should return 1 or for a embedded message it should return
5. If you want to access an attachment that is within the embedded message
then you need to call X-MS-ENUMATTS against the URL of the embedded
message.
Eg Something like this
strURI = "http://servername/Exchange/mailbox/Inbox/item.EML"
set req = createobject("microsoft.xmlhttp")
req.open "X-MS-ENUMATTS", strURI, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
set resDoc = req.responseXML
Set objPropstatNodeList = resDoc.getElementsByTagName("a:propstat")
Set objHrefNodeList = resDoc.getElementsByTagName("a:href")
If objPropstatNodeList.length > 0 Then
wscript.echo objPropstatNodeList.length & " attachments found..."
For i = 0 To (objPropstatNodeList.length -1)
set objPropstatNode = objPropstatNodeList.nextNode
set objHrefNode = objHrefNodeList.nextNode
wscript.echo ""
wscript.echo "Attachment: " & objHrefNode.Text
set objNode =
objPropstatNode.selectSingleNode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode.selectSingleNode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode.Text)
else
set objNode1 =
objPropstatNode.selectSingleNode("a:prop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
Set req = Nothing
sub embedattach(objhref)
req.open "X-MS-ENUMATTS", objhref, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
wscript.echo ""
wscript.echo "Embedded Message"
set resDoc1 = req.responseXML
Set objPropstatNodeList1 = resDoc1.getElementsByTagName("a:propstat")
Set objHrefNodeList1 = resDoc1.getElementsByTagName("a:href")
If objPropstatNodeList1.length > 0 Then
wscript.echo objPropstatNodeList1.length & " attachments found..."
For i = 0 To (objPropstatNodeList1.length -1)
set objPropstatNode1 = objPropstatNodeList1.nextNode
set objHrefNode1 = objHrefNodeList1.nextNode
wscript.echo "Attachment: " & objHrefNode1.Text
set objNode =
objPropstatNode1.selectSingleNode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode1.selectSingleNode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode1.Text)
else
set objNode1 =
objPropstatNode1.selectSingleNode("a:prop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
end sub
Cheers
Glen

Jul 21 '05 #3
Thanks!

Li

"Kevin Yu [MSFT]" wrote:
Hi Li,

I noticed that an MVP Glen Scales has replied to you in anothor thread in
icrosoft.public.exchange2000.development. For convenience, I paste his
reply here. If you are still having questions, please reply to the post,
and I will find more resources for you. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
You should be able to use the CN which should be there wether its a normal
attachment or an embedded message. You might also want to look at using the
PR_ATTACH_METHOD (http://schemas.microsoft.com/mapi/proptag/x37050003) this
will tell you what type of attachment you are dealing with eg for a normal
attachment this should return 1 or for a embedded message it should return
5. If you want to access an attachment that is within the embedded message
then you need to call X-MS-ENUMATTS against the URL of the embedded
message.
Eg Something like this
strURI = "http://servername/Exchange/mailbox/Inbox/item.EML"
set req = createobject("microsoft.xmlhttp")
req.open "X-MS-ENUMATTS", strURI, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
set resDoc = req.responseXML
Set objPropstatNodeList = resDoc.getElementsByTagName("a:propstat")
Set objHrefNodeList = resDoc.getElementsByTagName("a:href")
If objPropstatNodeList.length > 0 Then
wscript.echo objPropstatNodeList.length & " attachments found..."
For i = 0 To (objPropstatNodeList.length -1)
set objPropstatNode = objPropstatNodeList.nextNode
set objHrefNode = objHrefNodeList.nextNode
wscript.echo ""
wscript.echo "Attachment: " & objHrefNode.Text
set objNode =
objPropstatNode.selectSingleNode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode.selectSingleNode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode.Text)
else
set objNode1 =
objPropstatNode.selectSingleNode("a:prop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
Set req = Nothing
sub embedattach(objhref)
req.open "X-MS-ENUMATTS", objhref, false, "", ""
req.send
If req.status > 207 Or req.status < 207 Then
wscript.echo "Status: " & req.status
wscript.echo "Status text: " & req.statustext
wscript.echo "Response text: " & req.responsetext
Else
wscript.echo ""
wscript.echo "Embedded Message"
set resDoc1 = req.responseXML
Set objPropstatNodeList1 = resDoc1.getElementsByTagName("a:propstat")
Set objHrefNodeList1 = resDoc1.getElementsByTagName("a:href")
If objPropstatNodeList1.length > 0 Then
wscript.echo objPropstatNodeList1.length & " attachments found..."
For i = 0 To (objPropstatNodeList1.length -1)
set objPropstatNode1 = objPropstatNodeList1.nextNode
set objHrefNode1 = objHrefNodeList1.nextNode
wscript.echo "Attachment: " & objHrefNode1.Text
set objNode =
objPropstatNode1.selectSingleNode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode1.selectSingleNode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(objHrefNode1.Text)
else
set objNode1 =
objPropstatNode1.selectSingleNode("a:prop/d:x3704001f")
wscript.echo "Attachment name: " & objNode1.Text
end if
next
Else
wscript.echo "No file attachments found..."
End If
End If
end sub
Cheers
Glen

Jul 21 '05 #4
You're welcome!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lev | last post by:
Hi all, Please help with the subj. I use WebDAV for sending emails via MS Exchange 2003 Server. Tnx, Lev
3
by: Glenn Holliday | last post by:
I want an Access application to use an .mdb file via WebDAV in a remote directory. The Access documentation is silent as far as I can find. I've received some opinions that since Office XP adds...
3
by: Wizard | last post by:
In Access, using VBA, I am sending emails based on query results. These email include relevant information to a scheduled event the recipient is assigned to. This is working great. What I have...
2
by: George Durzi | last post by:
We recently upgraded to Exchange2K3/W2K3 from Exchange2K/W2K, and some of my c# code that I used to access users' contacts using WebDAV has stopped working. I'm getting a 401 unauthorized error....
4
by: Li Weng | last post by:
Hi, Within WebDAV I can use "X-MS-ENUMATTS" and "attachmentfilename" to get attachment file names. But if the attachment is another email, it doesn't come with "attachmentfilename". My...
0
by: Telos | last post by:
I'm trying to write a windows service which reads some emails from Exchange Server through WebDAV, using C#.NET 2.0. Everything works fine when testing, using a little Forms application to test...
7
by: Wiebe Tijsma | last post by:
Hi, I'm using C# + webDAV to create a draft message to be sent in a user's Drafts folder. I can create the message successfully, however when I open the message in outlook, it doesn't show...
1
by: ysblokkie | last post by:
Hi guys, Is anybody here using the webdav technology to send emails etc? I have used the component provided by IndependentSoft, but it is only an evaluation version (and a bit out of my price...
2
by: planetthoughtful | last post by:
Hi All, I need to build a console app that can connect to a mailbox on a Microsoft Exchange 2000 Server located on our intranet to do the following: - go through all emails in the inbox -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.