473,804 Members | 3,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebDAV to access attached emails

Hi,

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

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

Li

Jul 21 '05 #1
4 3164
Hi Li,

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

PS: microsoft.publi c.exchange.deve lopment 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.d evelopment. 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_METHO D (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("m icrosoft.xmlhtt p")
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.responsetex t
Else
set resDoc = req.responseXML
Set objPropstatNode List = resDoc.getEleme ntsByTagName("a :propstat")
Set objHrefNodeList = resDoc.getEleme ntsByTagName("a :href")
If objPropstatNode List.length > 0 Then
wscript.echo objPropstatNode List.length & " attachments found..."
For i = 0 To (objPropstatNod eList.length -1)
set objPropstatNode = objPropstatNode List.nextNode
set objHrefNode = objHrefNodeList .nextNode
wscript.echo ""
wscript.echo "Attachment : " & objHrefNode.Tex t
set objNode =
objPropstatNode .selectSingleNo de("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode .selectSingleNo de("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(obj HrefNode.Text)
else
set objNode1 =
objPropstatNode .selectSingleNo de("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(obj href)
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.responsetex t
Else
wscript.echo ""
wscript.echo "Embedded Message"
set resDoc1 = req.responseXML
Set objPropstatNode List1 = resDoc1.getElem entsByTagName(" a:propstat")
Set objHrefNodeList 1 = resDoc1.getElem entsByTagName(" a:href")
If objPropstatNode List1.length > 0 Then
wscript.echo objPropstatNode List1.length & " attachments found..."
For i = 0 To (objPropstatNod eList1.length -1)
set objPropstatNode 1 = objPropstatNode List1.nextNode
set objHrefNode1 = objHrefNodeList 1.nextNode
wscript.echo "Attachment : " & objHrefNode1.Te xt
set objNode =
objPropstatNode 1.selectSingleN ode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode 1.selectSingleN ode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(obj HrefNode1.Text)
else
set objNode1 =
objPropstatNode 1.selectSingleN ode("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.d evelopment. 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_METHO D (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("m icrosoft.xmlhtt p")
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.responsetex t
Else
set resDoc = req.responseXML
Set objPropstatNode List = resDoc.getEleme ntsByTagName("a :propstat")
Set objHrefNodeList = resDoc.getEleme ntsByTagName("a :href")
If objPropstatNode List.length > 0 Then
wscript.echo objPropstatNode List.length & " attachments found..."
For i = 0 To (objPropstatNod eList.length -1)
set objPropstatNode = objPropstatNode List.nextNode
set objHrefNode = objHrefNodeList .nextNode
wscript.echo ""
wscript.echo "Attachment : " & objHrefNode.Tex t
set objNode =
objPropstatNode .selectSingleNo de("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode .selectSingleNo de("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(obj HrefNode.Text)
else
set objNode1 =
objPropstatNode .selectSingleNo de("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(obj href)
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.responsetex t
Else
wscript.echo ""
wscript.echo "Embedded Message"
set resDoc1 = req.responseXML
Set objPropstatNode List1 = resDoc1.getElem entsByTagName(" a:propstat")
Set objHrefNodeList 1 = resDoc1.getElem entsByTagName(" a:href")
If objPropstatNode List1.length > 0 Then
wscript.echo objPropstatNode List1.length & " attachments found..."
For i = 0 To (objPropstatNod eList1.length -1)
set objPropstatNode 1 = objPropstatNode List1.nextNode
set objHrefNode1 = objHrefNodeList 1.nextNode
wscript.echo "Attachment : " & objHrefNode1.Te xt
set objNode =
objPropstatNode 1.selectSingleN ode("a:prop/d:x37050003")
wscript.echo "Attachment Method: " & objNode.Text
set objNode2 = objPropstatNode 1.selectSingleN ode("a:prop/f:cn")
wscript.echo "CN: " & objNode2.Text
if objNode.Text = 5 then
embedattach(obj HrefNode1.Text)
else
set objNode1 =
objPropstatNode 1.selectSingleN ode("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
1102
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
5044
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 more support for WebDAV, there may be a way to do it from Access. But by experiment, I believe the only way to do it is to write at the DAO layer. I've been brainstorming IIS tricks to make the WebDAV directory look like an ordinary location to
3
4762
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 been ask to do now is to include an attached file, that when opened will be an Outlook Calendar event and when saved the event will be added to the recipient's calendar in Outlook. These files are .vcs files. I am able to create the necessary...
2
2797
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. Hopefully, I can explain this adequately. Prior to the upgrade the following code was working properly. FYI: The site was running in the context of the domain administrator, and was also using the Administrator account to create a CredentialCache...
4
808
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 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.
0
1450
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 all the backend classes. However, when I try to run the actual service it gets an access denied message when trying to get the emails. We have other services written in VB.NET 1.1 which use the exact same technique, and run on the same server......
7
3492
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 the 'send' button, (only 'reply' etc as if it was a received message). I'm using exchange explorer to see the difference in webDAV properties
1
1788
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 range), and I am now trying to write my own class to send emails via WebDav. Currently, I am able to send mails in HTML format. What I want to do however, is embed images in the email. Does anybody know how to do this? I am lost lost lost and...
2
1364
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 - test these emails for whether or not they have attachments that meet a specific filename pattern - save any attachments that meet the pattern to a local drive
0
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10311
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9138
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.