ewsjavaapi

Error while sending mails using EWSJavaAPI

梦想与她 提交于 2020-01-15 12:48:09
问题 I am trying to send mails from my java web application by using EWS Java api. But ia m getting an error when sending mails. We have Exchange 2013 server installed. Here is my code ExchangeService service = new ExchangeService(); ExchangeCredentials credentials = new WebCredentials("username","password"); service.setCredentials(credentials); try { service.setUrl(new URI("host/ews/Exchange.asmx")); service.setTraceEnabled(true); EmailMessage msg = new EmailMessage(service); msg.setSubject(

Invalid Named Property

你说的曾经没有我的故事 提交于 2020-01-06 05:56:48
问题 We call the microsoft exchange to set the extended property which in our case is an unique guid microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: An internal server error occurred. The operation failed., Invalid named property Its been working great until now when some of our users are facing the above issue .... val uId = getUniqueId(); val emailExtendedPropDef = new ExtendedPropertyDefinition(uId,"uniqueId", MapiPropertyType.String) try { email

How to set the contact title using the EWS Java API (Exchange Web Service)?

烂漫一生 提交于 2019-12-23 21:15:24
问题 I would like to achieve the exact same thing as asked in this question, but in java: How to set the contact title using Exchange Web Services Managed API I am using the EWS Java API 1.2 (http://archive.msdn.microsoft.com/ewsjavaapi). I can create a contact with all fields exposed in the API, but not the title (or Email1DisplayName). I tried these combinations (no errors, but title remains empty in the created contact when looking at it in Outlook): contact.setExtendedProperty(new

How to retrieve the extendedProperties associated with emails in the sent folder from exchange

99封情书 提交于 2019-12-11 14:25:07
问题 We have created extendedProperties on emails using val uId = getUniqueId(); val emailExtendedPropDef = new ExtendedPropertyDefinition(uId,"uniqueId", MapiPropertyType.String) try { email.setExtendedProperty(emailExtendedPropDef, uId.toString) email.sendAndSaveCopy() } catch { case e: Exception => error(s"Exception in setting extended property for user $from", e) throw e } Now we want to iterate over the emails in sent folder and go over the extendedProperties for the emails that have been set

Message body changes after updating EmailMessage

坚强是说给别人听的谎言 提交于 2019-12-11 07:57:10
问题 My target is to load an email message and if it's a new one mark it as read. So here is what I am doing: EmailMessage email=EmailMessage.bind(service,itemId); email.load(); email.setSubject(GeneralUtils.replaceSpecialCharacters(email.getSubject())); email.setBody(MessageBody.getMessageBodyFromText(GeneralUtils.replaceSpecialCharacters(email.getBody().toString()))); if(!email.getIsRead()){ email.setIsRead(true); email.update(ConflictResolutionMode.AutoResolve); } ISSUE: When reading the

How to get DL in Exchange Server using Java API?

坚强是说给别人听的谎言 提交于 2019-12-11 03:58:42
问题 How to get DL (distribution List) from Microsoft Exchange Server via EWS in Java? I have tried EWS Java API but could not find list of Distribution List (GAL) of exchange server, any help regarding to this API or any other would be appreciated. 回答1: The GAL is not directly supported. You can use the ResolveNames method to resolve individual names. To perform a search on the GAL, you need to use LDAP. See http://www.infinitec.de/post/2005/02/How-to-get-the-Global-Address-List-programatically

NoSuchMethodError on ews-java-api

徘徊边缘 提交于 2019-12-11 02:49:47
问题 I'm having some issues trying to use exchange webservices for java. I'm getting following NoSuchMethodError . java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/protocol/HttpClientContext; I've tried reinstalling ews-java-api several times but it hasnt been solving the problem as i believed it would. I'm currently working in Android Studio. Full stack: 03-25 15:37:23.551 1875-1875/com.example.XXXXX.test E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.example

Exchange Web Service find EmailMessage by “Message-ID” header

☆樱花仙子☆ 提交于 2019-12-10 17:56:26
问题 I'm using the Java EWS library and try to reply to some messages. The main question is - how to find EmailMessage in folder or in mailbox if I only know value of "Message-ID" header of my message. I try to do something like this: ExtendedPropertyDefinition p = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Message-ID", MapiPropertyType.String) myfolder.findItems(new SearchFilter.IsEqualTo(p, "<1031208507.471.1446200157453.JavaMail.test>"), new ItemView(1)) But

Download attachments using Exchange Web Services Java API?

*爱你&永不变心* 提交于 2019-12-10 03:57:54
问题 I am writing a Java application to download emails using Exchange Web Services. I am using Microsoft's ewsjava API for doing this. I am able to fetch email headers. But, I am not able to download email attachments using this API. Below is the code snippet. FolderId folderId = new FolderId(WellKnownFolderName.Inbox, "mailbox@example.com"); findResults = service.findItems(folderId, view); for(Item item : findResults.getItems()) { if (item.getHasAttachments()) { AttachmentCollection

EWS Java API get Attachment

妖精的绣舞 提交于 2019-12-08 04:16:34
问题 I have some issue in getting some attachment using ews java API 1.3 SNAPSHOT, i want to get Attachment in my email, here my code : try { ExchangeService service; service.setUrl(new URI("https://" + myserver + "/ews/Exchange.asmx")); ExchangeCredentials credentials = new WebCredentials(username, password); service.setCredentials(credentials); ItemView view = new ItemView(Integer.MAX_VALUE); view.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Ascending); Folder folder = Folder.bind