PDA

View Full Version : webdav add attachment



Mauricio
07-07-2010, 09:49 AM
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