Search code examples
node.jsgmailmailgunemailoutlook.com

Integrating email providers with my Application


I have a web app built on React, and backend on NestJs. I want to integrate email platforms to my app. Let's say a user signed up in my app and then he uses other functionalities in the app. Then he wants to receive and send emails using my app and for that, he must integrate his email account (whether Gmail, Hotmail or any other email provider) with my app.

How can I provide such functionality? and What does it call?

I have tried to research a bit on it on Google and found some options like Nylas and MailGun. But I'm not sure if they are according to my case scenario.

Any lead and suggestion is appreciated. Thanks


Solution

  • You will need an IMAP client to retrieve received emails from the remote servers (of Google, Microsoft etc.) you should be able to use IMAP Simple package.

    Additionally you will also need an SMTP client to send emails and for this, you would need SMTP Client.

    This would require the users to disclose their SMTP/IMAP details or in some cases their actual login details which might make them uncomfortable; however this approach is universal with almost all mail service providers/servers.

    Alternatively if you are just targeting Gmail you can use the Gmail API where users would grant your app the permissions to send and access their mails.

    You can also use the Microsoft Graph interface to access their Mail API to both send and receive emails from Hotmail / Outlook.