How to send email via sendMail API using an Outlook email alias and MIME format

Jacopo Beschi 0 Reputation points
2024-09-17T12:40:48.6633333+00:00

Hi, I am Jacopo, a programmer for the HEY.com email service.

In HEY.com, we let users connect their external Microsoft email addresses with our app to send emails. Initially, this was done via SMTP Auth, but after your announcement to dismiss SMTP Auth, we switched to Oauth2 and API. In particular, we rely on the sendMail API, using the Mime format.

The integration works well except for the case when the user has one (or more) Outlook email aliases set up, in this case, they can't send any email from their email aliases because their primary email contact is forcefully set in the "from" field for each email they send, even if we explicitly set their alias in the "from" field of the Mime email. I know the JSON format allows setting a custom sender via the "from: { emailAddress: { address: ... } }" field. Still, we can't use it because the JSON format doesn't allow setting a custom "in-reply-to" header, which we use to ensure correct email threading in the app and the other clients.

How is possible to set an Outlook email alias as "from" when sending an email via the sendMail API and using the Mime format?

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

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.