简体   繁体   中英

Retrieving mails by EWS and sending with Java Mail API

I am during porting an application using IMAP and SMTP to communicate with mail server. At the beginning I planned to change only IMAP protocol to EWS API, but I am wondering is even makes sense/is possible? I mean, I would retrieve mails with EWS and perform actions like reply or archive with Java Mail API. The first complication is to map Object representing email message in EWS (EmailMessage) to analogue one in Java Mail API (Message). But even if I would able to, I am not sure if its reliable. In this case, should I port whole communication with mail server to EWS?

Best Regards!

It would probably be better if you could do it all with EWS or all with JavaMail.

If EWS can produce a MIME formatted byte stream for the message, you can use that to construct a JavaMail MimeMessage and then handle the rest with JavaMail, if you need to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM