Getting Latest Response using Aspose Email API in Java

Hi Team,

One query is that - Do we have a way to get latest response in an email using AsposeEmail API using Java. If yes, please share the code snippet to test.

Below is the scenario

Sender - Hello, this is test mail from Sender.
Receiver - Received the above email and Replied “Noted sender”

Desired output is - “Noted sender”

This is the required output to use in our internal application.

Thanks
Phanikumar P
+91-9985079507

@nvphani

Aspose.Email provides functionality to get and filter messages based on some condition using MailQuery class. The MailQuery class provides various properties for specifying the conditions based on date, subject, sender, recipient and so on.
Please follow the link given below for more details.
https://docs.aspose.com/display/emailjava/Working+with+Messages+from+IMAP+Server#WorkingwithMessagesfromIMAPServer-Today’sDate
This link provides code snippets for fetching MailBox messages that meet specific criteria like as:

  1. Today’s date
  2. A date range
  3. From a specific sender
  4. From a specific domain
  5. From a specific recipient
    Moreover, for new or unread messages you may read IsRead property which returns Boolean value for the message read status like as below:

ImapMessageInfoCollection messages = client.listMessages(query);
for (ImapMessageInfo info : messages) {
System.out.println("Is Read: " + info.isRead());
}

However, for replying an email you may follow the link below describing how to send email messages using SMTP client.
https://docs.aspose.com/display/emailjava/Sending+and+Forwarding+Messages

Aspose.Email API also provides support of email tracking using Message Disposition Notification (MDN). You may create and retrieve the information whether read receipts are requested. Please find more details at this link:
[https://docs.aspose.com/display/emailjava/Support+for+Email+Tracking ](https://docs.aspose.com/display/emailjava/Support+for+Email+Tracking)