Unable to send reply’s in a specific format from the application when EWS is configured

Unable to send reply’s in a specific format from the application when EWS is configured

 When trying to send reply mail, if a user mail address is entered in the format "Name<email-address>", then an exception in EWS since, could not resolve this toaddress.

Log Trace : 

  1. [22:10:27:393]|[09-21-2022]|[SYSERR]|[INFO]|[157]: microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: At least one recipient is not valid., Recipient 'name <xyz@xyz.com>' is not resolved. All recipients must be resolved before a message can be submitted.
  2. [22:10:27:393]|[09-21-2022]|[SYSERR]|[INFO]|[157]: at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278)|
  3. [22:10:27:393]|[09-21-2022]|[SYSERR]|[INFO]|[157]: at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267)|


Cause :

      Issue occurs in the EWS Mail & not in JAVAMAIL(SMTP)  which are explained below.
In Javamail, the toaddresses & ccaddresses are parsed before sending layer and In EWS, the addresses are not parsed before sending layer.
  1.  emailMessage.getToRecipients().add(address);

Fix :

In EWS, Address are parsed before sending layer.
  1. emailMessage.getToRecipients().add(new InternetAddress(address).getAddress());
Multiple Mail Addresses should be separated by comma (,) in those fields.

Build Compatiblity : 13008


Ref Ticket : 8104298 

      New to ADSelfService Plus?

        Resources