DB mail not working

Mail stuck in ExternalMailQueue 

This login ([NT SERVICE\MSSQLSERVER ) is needed, no matter DB mail was configured under which service account. 

The original SQL service account is NT Service\MSSQLSERVER

 

 

Configure Database mail under SQL service account - NT Service\MSSQLSERVER

 

Next, change the service account to another AD account  + drop login [NT SERVICE\MSSQLSERVER]

 

 

DROP LOGIN [NT SERVICE\MSSQLSERVER]

GO

 

 

Then the issue is reproduced : 

 

Mail stuck in ExternalMailQueue

 

Don't see "Database process is started " and no additional errors in sysmail_log / sysmail_event_log 

 

 

But, in Application event we do see  the permission denied error

 

 

 

Database Engine Instance=SQL1;Mail PID=1048;Error Message:The update to the database failed. Reason: The EXECUTE permission was denied on the object 'sysmail_logmailevent_sp', database 'msdb', schema 'dbo'.

 

 

After re-creating the SQL login, the DB mail function works!

 

 

CREATE LOGIN [NT SERVICE\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english]

GO

 

ALTER SERVER ROLE [sysadmin] ADD MEMBER [NT SERVICE\MSSQLSERVER]

GO