Some providers will return an error when you define a From or will replace the value with the default User Principle Name / account address.
Ensure you have the alias setup:
- With the provider - requires the mail administrator involvement
- Within your mail client - for Gmail this is in Settings > Accounts > Send mail as
Providing they have the alias setup within their provider, allowed to send as, then they can use the
from attribute in the message endpoint.
Please reach out to the mail administrator if the from field is not accepted.