Forum Discussion

hmmmm007's avatar
hmmmm007
Copper Contributor
Sep 07, 2023
Solved

Change the server name in the HELO exchange in SQL Server Database Mail

When my SQL Database mail connects to my SMTP provider (SendGrid) it shows the local server name rather than the FQDN. I would like to find the configuration setting so that the HELO exchange uses th...
  • hmmmm007's avatar
    hmmmm007
    Sep 08, 2023

    olafhelper  It turns out there is one. I received the answer from another forum. Excerpts below:

     

    "since DatabaseMail.exe is the application that actually sends the emails, and it uses SmtpClient apparently, you can try adding to the XML configuration file at DatabaseMail.exe.config. This is located in your SQL Server instance location, in a folder called Binn."

     

     

    <configuration>
      <system.net>
        <mailSettings>
          <smtp>
            <network clientDomain="MailServer.XYZDomain.com" />
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>

     

     

    This solved the issue for me. HTH

     

    PS: It is important to note that the database mail service must be stopped and restarted after the configuration changes have been made, if the database mail service was running running when the changes were made. This can be done with the "EXECUTE msdb.dbo.sysmail_stop_sp" and "EXECUTE msdb.dbo.sysmail_start_sp" commands.

Resources