Issue for concurrent emails. Sender address is getting overlap.

AKP1990 0 Reputation points
2025-02-05T11:29:23.3433333+00:00

I am facing strange behavior for mails while using microsoftgraphapi. I am using below code. Issue is when 2 mails are getting triggered at same time, the sender's email id get overlapped. Suppose -> one mail sender is ******@abc.com and 2nd mail sender is ******@abc.com. When triggered at same time. The sender address of 2nd becomes ******@abc.com or vice -versa. The log prints the correct sender email ID. There is no such issue when mail is triggered at different time or after 1 or 2 mins, at that time senders are correct. The log shows correct id i.e ******@abc.com but sent from A.

Message message = generateEmailMessageForGraphAPI(emailMessageModel, emailBody);
LOG.error("From Mail Address is :-" +emailMessageModel.getFromAddress().getEmailAddress());


boolean saveToSentItems = true;

graphClient.users(userId)
        .sendMail(UserSendMailParameterSet
                .newBuilder()
                .withMessage(message)
                .withSaveToSentItems(saveToSentItems)
                .build())
        .buildRequest()
        .post();
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,028 questions
{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.