web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to change the sender of an email using Microsoft Graph?

(2) ShareShare
ReportReport
Posted on by 845
Hello,
I have created a class that I use for sending emails, depending on how the system is configured for email sending. Currently, we are using Microsoft Graph. Unfortunately, I am unable to change the sender. Can anyone suggest how to do this?
Here is a snippet of the code. I am using the SysMailerMessageBuilder class to create the message.
 
/.../ 
messageBuilder.setFrom(sender);

 Map sysMailers = SysMailerFactory::getMailers();
 SysIMailer mailer = sysMailers.lookup(SysEmailParameters::find().MailerNonInteractive);

 if (mailer is SysIMailerNonInteractive)
 {
     SysIMailerNonInteractive nonInteractiveMailer = mailer;
     nonInteractiveMailer.sendNonInteractive(messageBuilder.getMessage());
 }
 
Categories:
I have the same question (0)
  • MichaelTorres Profile Picture
    86 on at
    Hello,
     
    Make sure the account used with Graph has "Send As" or "Send on Behalf" permissions for the desired sender, or if you’re using application permissions, check that it’s configured to send on behalf of other mailboxes.
  • Shooowtek Profile Picture
    845 on at
    How to check the configuration if I am using Application permissions?
  • Suggested answer
    Anthony Blake Profile Picture
    3,208 Super User 2026 Season 2 on at
    I'm not sure you can do this with Graph, it sends as the currently signed in user, and for batch jobs sends as the user which configured the batch job, so  again, the user the code is running as. This can be controlled at user level be setting the sender address to another mailbox. There may be a way around it, but I haven't come across it yet.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 345 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 304

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans