How to override display name sent from an SMTP server to an Outlook mail (email blast)?

Gerald 0 Reputation points
2025-12-04T01:51:18.83+00:00

Hi, I am trying to send an email via SMTP server (inside a Node.js app). It works fine if the recipient is not an Office365 user since sending an email to a Gmail account displays the custom display name just fine. Based on this scenario, I don't think it has anything to do with the SMTP server rather, an Outlook restriction or something of that sort. Though, on another application (PHP based using PHPMailer), the custom display name works just fine on Outlook recipients. Since I am using Nodemailer, I already tried the documentation format like this: "Display Name" ******@domain.com but it only works with Gmail recipients.

Thanks in advance for your responses!

Outlook | Windows | New Outlook for Windows | For business
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-04T01:51:30.7033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    When sending emails via SMTP to Outlook recipients, the display name that appears can be influenced by how the email is formatted and the standards adhered to. Here are some key points to consider:

    1. Format of the From Address: Ensure that the format of the From address follows the recommended structure: From: "Display Name" <EmailAddress>. The display name should be enclosed in double quotes, especially if it contains special characters or commas.
    2. MAPI Properties: Outlook uses MAPI properties to interpret the email address components. The display name for all recipients is mapped to the PR_DISPLAY_NAME property. If the display name is not set correctly, Outlook may default to showing the email address instead.
    3. Length Restrictions: If the total length of the email address plus display name exceeds 255 characters, the display name may be dropped. Make sure that your display name and email address combined do not exceed this limit.
    4. Testing with Different Libraries: Since you mentioned that PHPMailer works correctly, it may be beneficial to compare how both libraries handle the SMTP settings and the formatting of the email headers. Ensure that your Node.js application is setting the headers in a similar manner to PHPMailer.
    5. SMTP Server Configuration: Although you believe the SMTP server is not the issue, ensure that it is configured correctly to handle the display name and that there are no restrictions imposed by the server that could affect how the display name is sent.

    If you continue to face issues, consider checking the specific email headers sent by both applications to identify any discrepancies that could affect how Outlook interprets the display name.


    References:

    0 comments No comments

  2. Kha-N 5,455 Reputation points Microsoft External Staff Moderator
    2025-12-04T03:01:47.4666667+00:00

    Hi @Gerald,

    Welcome to Microsoft Q&A, and thank you very much for reaching out to us.

    Please note that as a Microsoft Q&A moderator, I don’t have access to your configuration, and my knowledge of custom applications is limited. I can only assist based on available documentation and research, but I’ll do my best to help.

    Based on your description, I reviewed both the Nodemailer and PHPMailer documentation and confirmed that the format you used is correct.

    Note: Microsoft is providing this information as a convenience to you. These sites are not controlled by Microsoft, and Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please ensure that you fully understand the risks before using any suggestions from the above link.

    I also checked Microsoft documentation on how user validation works, and your format aligns with those guidelines.

    User's image

    Since it works with Gmail, your configuration is definitely not the issue here.

    From my research, if the user is on Exchange, this behavior is by design. According to Microsoft documentation, the display name cannot be changed from the client side, only the Exchange administrator can make this change.

    User's image

    This to prevent spoofing and ensure identity consistency, according to Microsoft Article on validate the From address to prevent phishing mentioned earlier.

    User's image

    I also found an older Stack Overflow thread where one user confirming this behavior.

    User's image

    This link will take you to StackOverflow, which is outside Microsoft’s domain. Please note that Microsoft is not responsible for the accuracy, security, or advertising on external sites.

    Regarding why PHPMailer might appear to bypass this restriction, I researched further but could not find any official Microsoft documentation or community thread confirming such behavior.

    Based on my understanding and experience, this difference likely occurs when Outlook cannot resolve the sender to a directory or contact entry. In that scenario, Outlook falls back to using the email address as the display name. If a custom display name is set in the header and no GAL resolution exists, Outlook may display that custom name.

    I also came across a ServerFault thread which, while it does not specifically mention custom display names, does explain what Outlook does when it cannot find a display name in the GAL list.

    User's image

    This link will take you to ServerFault, which is outside Microsoft’s domain. Please note that Microsoft is not responsible for the accuracy, security, or advertising on external sites.

    For workaround, as far as I know, Microsoft suggest using the IP Allow List (connection filtering) or mail flow rules (also known as transport rules), as described in Create sender allowlists. For personal (Outlook.com) accounts however, Outlook.com does not support any overrides, even though support requests.

    User's image

    Thank you for your understanding.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.