Forum Discussion
Change the server name in the HELO exchange in SQL Server Database Mail
- 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.
I have not been able to find a config setting anywhere that controls that HELO value.
Because there isn't one.
SQL Server acts as a very simple email client, you can't modify the behaviour.
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.