Is there any api for email communication

Akshiya 20 Reputation points
2025-05-12T07:22:55.6233333+00:00

Scenario:

Each sales team member has their own domain-based email ID (e.g., ******@company.com, ******@company.com, etc.).

In the CRM, each member creates their own leads.

The email flow goes like this:

A welcome email is sent to the lead.

  If no response, a **follow-up email** is sent.
  
     If the lead responds, the **sales member replies** to the email.
     

The challenge is:

Emails should be sent from the respective sales member's email ID, not from a central/shared email.

I can't share email-sending code or credentials with each user directly.

My Questions: Is there any Microsoft API (e.g., Graph API) that allows sending emails on behalf of each user, using their own email ID?

What’s the recommended and secure way to implement this in a CRM system?

Do I need to register an app and get user consent to send emails from their account? If so, how do I manage it for multiple users?

Any guidance, documentation links, or sample implementations would be really helpful!

Thanks in advance. Scenario: Each sales team member has their own domain-based email ID (e.g., ******@company.com, ******@company.com, etc.).

In the CRM, each member creates their own leads.

The email flow goes like this:

A welcome email is sent to the lead.

  If no response, a **follow-up email** is sent.
  
     If the lead responds, the **sales member replies** to the email.
     

The challenge is:

Emails should be sent from the respective sales member's email ID, not from a central/shared email.

I can't share email-sending code or credentials with each user directly.

My Questions: Is there any Microsoft API (e.g., Graph API) that allows sending emails on behalf of each user, using their own email ID?

What’s the recommended and secure way to implement this in a CRM system?

Do I need to register an app and get user consent to send emails from their account? If so, how do I manage it for multiple users?

Any guidance, documentation links, or sample implementations would be really helpful!

Thanks in advance.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Mark Dicks 640 Reputation points
    2025-06-09T13:36:50.25+00:00

    Yes, Microsoft Graph API supports sending emails on behalf of users from their own email ID, and it’s well-suited for the kind of scenario you’ve described, but it must be set up securely and correctly.

    Summary of What You Need:

    • Microsoft Graph API can send emails on behalf of users.
    • You'll need to register an Azure AD App.
    • You must get user consent to send mail on their behalf.
    • Use OAuth 2.0 Authorization Code Flow to securely authenticate users.
    • Use delegated permissions, not application-wide credentials, for your use case.

    Microsoft Graph API Flow: Sending Email as a User

    API Endpoint

    POST https://graph.microsoft.com/v1.0/me/sendMail
    Authorization: Bearer {user_access_token}
    Content-Type: application/json
    

    The email will be sent from the authenticated user’s account (e.g., ******@company.com), provided they’ve consented to the Mail.Send permission. How to Manage Multiple Users

    Each sales team member will need to log in once to grant your app permission. You can:

    Store their refresh_token securely (encrypted).

    Automatically refresh access tokens as needed.

    This way:

    • You don’t need to manage their credentials.
    • Emails are always sent from their real accounts.
    • You comply with security best practices.

    Let me know if you need further help
    Kind regards
    Mark Dicks

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.