Adding an attachment to an email using WebDav

Adding an attachment to an email using WebDav

Post by Loui Merci » Tue, 21 Feb 2006 17:41:21


Is there a way to add an attachment to an email, using webdav. I have tried
the following but it is throwing a Unauthorized ( 401 ) error.

Request = (System.Net.HttpWebRequest)HttpWebRequest.Create(sRoot);

Request.Credentials = MyCredentialCache;

Request.Method = "PUT";

byte[] bytes = Encoding.UTF8.GetBytes((string)strBody);

Request.ContentLength = bytes.Length;


System.IO.Stream PUTRequestStream = Request.GetRequestStream();

PUTRequestStream.Write(bytes, 0, bytes.Length);

PUTRequestStream.Close();

Request.ContentType = "message/rfc822";

Response = (System.Net.HttpWebResponse)Request.GetResponse();
 
 
 

1. How to save email attachments, from exchange, using WebDAV in C#.NET?

2. Moving an attachment from one e-mail message to another with WebDAV?

Is it possible to move an attachment from one e-mail message to
another with WebDAV?

I have tried, but I get a 501 : Not implemented error.

The way I see it I cannot use PUT, because then I have to read the
attachment as a stream and since I am on a different domain the the
attachment itself I won't be able to load it. The are some security
issues with ADODB.Stream that I have encountered. I am using
javascript.

Any suggestions? The attachment I want to add already exists as an
attachment to an e-mail at the Exchange server. I only need to attach
it to another e-mail message.

One solution might be to create a web service at the exchange server
to perform the loading of the attachment for me and then do the PUT,
but I would prefer to avoid doing that.

Best regards,

Kurt

3. Email attachments over webdav?

4. Is it possible to move an attachment from one e-mail message to another with WebDAV?

5. Sending email with attachment via WebDAV and C#

6. Seeking vb.net webdav send email w/attachments example

7. Detect email attachment via WebDAV

8. Uploading of attachments using WebDAV

9. Adding an attachment to an e-mail using the SDK

10. Downloading message attachment using WebDAV

11. uploading a mail attachment using webdav

12. How To Remove an Attachment using WebDAV

13. uploading a mail attachment using webdav

14. Using InsertFile method of the Range object to add attachments to email created from inside Word.

15. Corrupt attachments using MailMessage.Attachments.Add()