Database Mail not working in SQL Server 2016

I recently had an issue sending mail for the first time from a SQL 2016 server – mails were queuing with sent_status = unsent in msdb.dbo.sysmail_allitems.

A search led to a bug relating to SQL 2016 being installed on a server without .NET 3.5 – indeed, the server in question had .NET 4.6.x but not 3.5. I performed the following listed workaround then restarted SQL Agent (not mentioned in article) and the mails were sent immediately;

Create the DatabaseMail.exe.config and drop it next to the DatabaseMail.exe under the Binn folder. You can use notepad.exe or any other editor to edit it. Just make sure you save it by using UTF-8 encoding (in notepad.exe, select Save As… and in the Encoding combo box, select UTF-8):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true"
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

The reason for this post is that on the KB article, MS says the bug was fixed in RTM CU2 and SP1 CU2. However the server I had the problem with was SP2 CU3. So either the bug wasn’t fixed until later or, more likely, applying CU2 or later doesn’t retrospectively fix the problem – it just stops it existing if a fresh install of a version beyond CU is performed, and you still need to fix/create the DatabaseMail.exe.config if you already had the problem.