Hi Mohammed
I have a small and customer specific implementation of EWS in a Mendix-module which contains:
If you know Java you can write it yourself. The latter is:
// BEGIN USER CODE
logger.info("Create draft email");
if (settings == null || settings.getUsername() == null || settings.getUsername().isEmpty()) {
throw new UserThrownException("To use Exchange the settings must be valid (SyncContacts)");
}
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
ExchangeCredentials credentials = new WebCredentials(settings.getUsername(), settings.getPassword(), settings.getDomain());
service.setCredentials(credentials);
service.setUrl(new URI(settings.getURL()));
try
{
EmailMessage replymessage = new EmailMessage(service);
EmailAddress fromEmailAddress = new EmailAddress(from);
replymessage.setFrom(fromEmailAddress);
for(Iterator<relations.proxies.Contact> address = addressees.iterator(); address.hasNext(); ) {
relations.proxies.Contact ad = address.next();
if (ad.getEmail() != null) {
replymessage.getToRecipients().add(ad.getEmail());
}
}
//replymessage.setInReplyTo(recipients);
replymessage.setSubject(subject);
replymessage.setBody(new MessageBody(body));
replymessage.save();
}catch (Exception e)
{
logger.error(""+e);
}
logger.info("msExchange send mail done");
return true;
// END USER CODE