June 13, 2017 at 12:05 pm
Hi there,
I have been attempting to troubleshoot my issue with email not being sent from the server and i'm running out of ideas. I have searched around completed the following:
First thing i have removed all mailitems:
DECLARE @getdate-2 datetime
SET @getdate-2 = GETDATE();
EXECUTE msdb.dbo.sysmail_delete_mailitems_sp @sent_before = @getdate-2;
GO
I ensure that Database mail is configured using this command:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE
GO
I have stopped and started the service:
EXEC msdb.dbo.sysmail_stop_sp;
EXEC msdb.dbo.sysmail_start_sp;
I confirmed the status of system has started:
EXECUTE dbo.sysmail_help_status_sp
I have SQL2008 which sends mail great and i mirrored all the settings for the database mail configuration and still no luck.
When i look here: SELECT * FROM sysmail_allitems
I see a sent status of unsent.
Any advice would be appreciated!
June 13, 2017 at 12:16 pm
there's an additional table to join to, the msdb.dbo.sysmail_event_log , where the [description] column will tell you exactly what the issue is;
it's typically an error from the mail server, username password required, relaying not allowed, etc
if you post the exact error message, we can help a bit betterSELECT top 100
mail.send_request_date As SentDate,
sent_status As Reason,
err.[description],
mail.*
FROM [msdb].[dbo].[sysmail_allitems] mail
inner join [msdb].[dbo].[sysmail_event_log] err
ON err.mailitem_id = mail.mailitem_id
WHERE mail.sent_status <> 'sent'
order by mailitem_id desc
Lowell
June 13, 2017 at 1:47 pm
Hi Lowell,
Thank you for the insight, I actually found the resolution which was actually on a reddit thread.
You don't need to install .NET 3.5. You only need to edit a config file.
Another less invasive workaround you may want to try is to put the missing config file next to the DatabaseMail.exe (see attachment).
The file needs to be put under "C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Binn" (actual path depends on the drive where you installed SQL2016 and the name of your SQL instance).
If the attachment file did not go thru, here's the content of that file (DatabaseMail.exe.config):
<?xml version="1.0"?><configuration><startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> <supportedRuntime version="v2.0.50727"/></startup></configuration>
February 25, 2019 at 2:59 pm
This post help me to resolve the same issue.. I was struggling because I didn't see any configuration issues in mail profile/account or anywhere.. Finally I created the DatabaseMail.exe.config file as mentioned in this post and it started working.
November 19, 2020 at 2:04 pm
This post help me to resolve the same issue
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply