Webdav add attachment

hi,

im using webdav, httpclient api, to send email to exchange 2007

with the following code i send a message successfully:

String strTempRelativeURI="https://webmail/exchange/user@email.com/Drafts/"; 

PutMethod pm = new PutMethod ("https://webmail/exchange/user@email.com/Drafts/test5.eml/"); 
pm.setRequestBody(body); 
client.executeMethod(pm); 

move(strTempRelativeURI + "test5.EML", strSubRelativeURI, null); 


public static void move(String urlOrigem, String urlDest, HttpConnection conn) 
throws Exception 
{ 

MoveMethod method = new MoveMethod(urlOrigem, urlDest,true); 
try { 
int rc = client.executeMethod(method); 
System.out.println("Return Code: " + rc); 
} 

finally { 
// release any connection resources used by the method 
method.releaseConnection(); 
} 

} 

how can send the message with an attachment?

thanks in advance

If you’re attempting to send an email why are you using WebDav?

You most likely should be using the java Mail and Activation APIs. You can download both from the Sun/Oracle site.

You will then need to look into multipart messages once you’ve been sending mail messages from the Mail API.