Database Mail fails to send with no errors in sysmail_event_log

  • I am attempting to set up Database Mail in SQL Server 2008R2 SP1 . I’ve done this so many times before that it feels like I can do it in my sleep. However, for one server it isn’t working.

    I set up the account and profile with a valid email account and exchange server. This has been done multiple times on this server during the troubleshooting process, so I am sure I am not fat-fingering something.

    When I attempt to send a test email it gets queued, but doesn’t send.

    Microsoft has good trouble-shooting steps for database mail (http://msdn.microsoft.com/en-us/library/ms188663.aspx) and I have gone through them. This is where I’m at….

    The Database Mail is started. This has been checked by executing EXEC msdb.dbo.sysmail_help_status_sp;.

    The Database Mail has been stopped and restarted.

    All of the logins (including my own) have been added to the DatabaseMailUserRole in the msdb database.

    The broker has been verified that it is running by executing SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb';

    The Database Mail XPs are enabled.

    The SQL Mail XPs are enabled.

    In the sysmail_allitems view, I can see all of my attempted emails, but the sent_status is “unsent” for all of the emails attempted under the current profile. Because I have deleted and recreated the profile a couple of times, the attempts made under the previous profiles show a status of “failed”.

    The only records in the sysmail_event_log are the records indicating that I stopped and restarted Database Mail with the sysmail_stop_sp and sysmail_start_sp procedures.

    I have also recycled the SQL services for good measure.

    Anyone see anything like this before?

    ...

  • I've seen a similar thing when there is a hard return in the subject line.

    Is any part of the recipients, subject line, or body dynamically created?

  • It occurs when trying to send a test email. Right-click on Database Mail, click on Sent Test E-Mail, and enter an address. Everything else is already populated.

    This is so frustrating.

    I did find the following in the Windows Application Log:

    Message: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config' is denied.

    Now for some REAL confusion. I am and admin on the box. But when I go to the C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config folder and look at the permissions, I cannot change the security settings. I cannot add a user (the buttons are greyed out).

    How can an administrator on a computer not be able to administer the computer?

    ...

  • Oh yeah - and don't try reinstalling .NET Framework 2.0. The message is "This product is already installed as part of the operating system" and exits out of the install. There is also no option to uninstall.

    So Windows 2008 R2 puts .NET Framework 2.0 on as part of the OS that cannot be removed or used by applications.

    Nice.

    I've run out of airspeed, altitude, and ideas all at the same time. Does anyone have anything?

    ...

  • I don't have a Server 2008 R2 handy but looking at a Server 2008 for that Microsoft.NET\Framework64\v2.0.50727\Config directory I have full rights. If you haven't already, you may want to look into the aspnet_regiis command line utility. The one for the version 2.0 Framework is located in the Framework64\v2.0.50727\ folder. From a command window with elevated permissions I would think you could reinstall that way. Just be sure to use the right one. Did you recently install the .NET Framework 4 or do anything with IIS that may have messed with the .NET installations?

    No conclusive answers here... Just thoughts that might help you along.

    SQL Managed

  • can you actually ping the SMTP server from the SQL server box? Are you going through a firewall?

    If service broker is running and you've set up the accounts and profiles it should work.

    The probability of survival is inversely proportional to the angle of arrival.

  • in some other dbmail related threads, there was a lot of examples/issues where even though dbmail was set up correctly, the service broker itself was not performing it's duties.

    as a results emails would be queued, but never went farther than that.

    I have yet to see a diagnostic SQL that shows when the Service broekr is "hung up"

    the fix was to stop and start the SLq server service itself (and not jus tthe mails ervice), and in some cases to reboot the server.

    I searched a bit, but could not find the specific examples of the posts i had participated in so far. i'll try another search and post anything if i can find it.

    So my suggestion is to first stop and start the SQL Services(if possible, do you have to wait for a mainaenance window?), and see if the mails get caught up, and then to bounce the server itself (if possible)

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Good point Lowell, I have seen that myself. He said he had restarted the services so assumed he had already done that.

    You can also use set NEW_BROKER if the db is not in use.

    The probability of survival is inversely proportional to the angle of arrival.

  • The service broker wasn't hung up. It was attempting to send but didn't have access to the .NET directory.

    However, I found the problem. Someone else installed SQL.

    The SQL Server service account was "Network Service". I changed it to Local Service, restarted the service, and got flooded with test emails.

    ...

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply