Fetching the emails and related info via IMAP
In this example, we have userA who has 1 email in her Inbox.
We will manually connect via IMAP — this is something that you will need to do programatically against the WebMail, at the time userA logs into your application.
After login, we do the following operations:
Select the desired Axigen folder — in our case, we chose the "Inbox"
We will need the count of the last email returned by IMAP — in our case, there's only one email, so that count will be also 1:
Fetch the UID of that email — we will need it for our deep link:
In our case, the ID returned by the IMAP server is also 1:
Fetch the content of that email so that we can process it and display it in our app:
You will notice that the IMAP server returns all the necessary headers, as well as the content of the body, which can be processed and used for building a body snippet.
Building the deep-linked URL
You can form the URL as follows:
In our case, we used a test server installed in our local network, which we access by IP.
As you can see, when accessing this URL in the browser, the WebMail opens it in its own tab.