How to Change the Office 365 SMTP Email Display Name Dynamically
Question details
The user needs to dynamically change the sender display name for emails sent through Office 365 SMTP via a custom application.

- Product
- Office 365 SMTP
- Device & OS
- not provided
- Scenario
- Sending automated invoices from an application on behalf of multiple customers using a shared sender email address.
- Observed behavior
- The custom display name set by the application's code is ignored by Microsoft-hosted Office 365 and reverts to the default account display name, despite working previously on GoDaddy-hosted Office 365.
Verify your application's programming language, authentication method (OAuth or Basic), and current SMTP library before modifying your email-sending architecture.
Migrate from SMTP Client Submission to Microsoft Graph API
Microsoft Exchange Online enforces strict sender address policies for standard SMTP. Using the Microsoft Graph API provides more flexibility for custom sender details.
Microsoft-hosted Office 365 tenants often enforce security policies that strip dynamic display names submitted via traditional SMTP to prevent email spoofing. Migrating to the Microsoft Graph API is the recommended approach for modern enterprise applications.
Log in to the Azure portal, navigate to Azure Active Directory, and register a new application to obtain your Client ID and Tenant ID.
Under API permissions, add Microsoft Graph and select the 'Mail.Send' application permission. Ensure admin consent is granted for the tenant.
In your application code, construct the email message using the Graph API format. Under the 'from' or 'sender' object, specify the 'emailAddress' containing both the routing 'address' and your dynamic 'name'.
Use your preferred programming language to send a POST request to 'https://graph.microsoft.com/v1.0/users/{id}/sendMail' passing your configured JSON payload.

Configure ProxyAddresses and Send As Permissions
If you must use SMTP, you can set up specific aliases (proxy addresses) for your customers and grant the master account Send As permissions.
Looking for a Lightweight Office Suite? Try WPS Office
While WPS Office does not manage email server configurations or SMTP relay routing, it provides a comprehensive, free alternative for creating, editing, and designing the invoice documents your application sends out.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install the application: Run the installer and follow the on-screen prompts to set up WPS Office on your device.
- 3. Open your invoice templates: Launch WPS Writer or Spreadsheets to open, edit, and export your professional invoice documents without losing formatting.

Frequently Asked Questions
Why does Microsoft-hosted Office 365 strip my custom sender display name?
Microsoft enforces strict anti-spoofing and security policies on its native hosted Exchange environments. By default, it often rewrites the sender display name to match the authenticated directory user to prevent phishing, unlike some legacy or third-party hosted setups (like GoDaddy) which may have more permissive default connector settings.
Can I use basic authentication for SMTP client submission?
Microsoft has deprecated Basic Authentication for Exchange Online. You must transition your application to use OAuth 2.0 authentication for SMTP client submission, or switch to the Microsoft Graph API.
Is it possible to dynamically override the 'Reply-To' address instead?
Yes. While Office 365 strictly controls the 'From' display name, it generally allows custom applications to dynamically set the 'Reply-To' header without stripping the information. This is a common workaround if customers need to reply directly to a specific department or account manager.




