Forum Discussion
How to Send-As a Distribution Group (via SSIS ScriptTask) via Exchange Online using Modern Auth?
You can send as a DG via Graph, just need to add the From property to your request (and have Send As granted on the DG, if you are using the delegate permissions model).
If I'm understanding your correctly, This means I'm not able to use an App-Registration Credentials and that I need to 'login' to MS Graph as a user which that user has Mail.Send Permissions for the Group and not application permissions (ApplicationAccessPolicy and client credentials).
So the user I'd need to login as would need to have MFA disabled, I'd need to store its password, etc in Key vault that the App-registration Client can get to.
then crate the ,mail payload and just include the From in the payload:
{
"message": {
"subject": "Hello from the DG",
"body": {
"contentType": "HTML",
"content": "<p>This is a test from the email address removed for privacy reasons distribution group</p>"
},
"from": {
"emailAddress": {
"address": "email address removed for privacy reasons"
}
},
"toRecipients": [
{
"emailAddress": {
"address": "email address removed for privacy reasons"
}
}
]
},
"saveToSentItems": "true"
}
- VasilMichevJul 22, 2025MVP
You can use application permissions. As you still need to use the /users/{id}/sendMail endpoint, a valid mailbox must exist, but other than that, no dependence on user credentials or anything.