Database Mail is not sending items in the Queue

  • Please post to the following:

    http://www.sqlservercentral.com/Forums/Topic1276632-1550-4.aspx#bm1276973

    I have a problem where Database Mail is not sending items in the Queue.

    Database mail is started; there are 4 items in the queue and is in an inactive state.

    I just setup Database Mail on another Server a week ago.:unsure:

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Test email worked?

    Are there any errors in the database mail log?

  • Hm, first thoughts are firewall and the other is tied to relay rights. In most organizations I have worked in the SMTP relay has to be allowed from an IP address. So every time I add a new SQL server I have to have it white-listed for relay otherwise what you have happening happens..

    CEWII

  • Test did not work, checking into SMTP?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Check the Database mail log say? What are the errors being reported?

    CEWII

  • If you have AV on the server, check to make sure the DataBaseMail.exe is not being blocked. McAfee blocks it by default in the mass mailing rule and it needs to be added to the exceptions list.

  • I made sure that the Server was not restricted by the SMTP Server Relay.

    I checked and the AV on that Server is the same as what is running on the other Servers.

    Thanks for the suggestions.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Can you telnet from that server to the SMTP server? that would show that at least the connection was possible..

    CEWII

  • ah. I will have to try that.

    I ran sp's, search the DB Mails Tables in MSDB and basically went through the entire troubleshooting process so I would not double that it has something to do with the SMPT Server.

    We are in the process of moving servers to a Data Center in a remote location of the country, changing IP Addresses, changing firewall settings, etc.

    Thanks.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I had an issue on one of my servers where this happened - and the solution was to log into the server and kill the databasemail executable. For some reason, it got hung up and wouldn't send any messages.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • I try killing the exe for DB Mail.

    I Did stop & start DB Mail.

    I guess that I could probably stop & restart the service via Services.

    Thanks for the feedback.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I enabled Database Mail and used the Wizard to configure Database Mail on another instance of the machine I'm have trouble with.

    I can send SMTP MAil through telnet.

    Something that I found odd was when the wizard finished There was a line "Revoke Access from "MyAccount" for guest.

    I suspect that I'm doing something wrong but I have pulled articles off the internet to be sure.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I also faced lot of issues while setting up database mail first time. But finally managed to configure it.

    So I've put all of those steps at one place, check this blog post: http://sqlwithmanoj.wordpress.com/2010/09/29/database-mail-setup-sql-server-2005/[/url]

    ... may help.

  • manub22 (3/14/2012)


    I also faced lot of issues while setting up database mail first time. But finally managed to configure it.

    So I've put all of those steps at one place, check this blog post: http://sqlwithmanoj.wordpress.com/2010/09/29/database-mail-setup-sql-server-2005/[/url]

    ... may help.

    I ran your scripts.

    I have set up Database mail several times.

    After running your scripts the mail gets queued but it does not get sent.

    Same problem as before.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I checked the Event Log and there are errors for Database Mail.

    This entry occurred when I restarted the server:

    1) Exception Information

    ===================

    Exception Type: System.TypeInitializationException

    TypeName: System.Data.SqlClient.SqlConnection

    Message: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void .ctor(System.String)

    HelpLink: NULL

    Source: System.Data

    StackTrace Information

    ===================

    at System.Data.SqlClient.SqlConnection..ctor(String connectionString)

    at Microsoft.SqlServer.Management.Common.SqlConnectionInfo.CreateConnectionObject()

    at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.OpenConnection(SqlConnectionInfo ci)

    at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.OpenConnection(String dbServerName, String dbName, String userName, String password)

    at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.QueueItemProcesser.ProcessQueueItems(String dbName, String dbServerName, Int32 lifetimeMinimumSec, LogLevel loggingLevel)

    2) Exception Information

    ===================

    Exception Type: System.TypeInitializationException

    TypeName: System.Data.SqlClient.SqlConnectionFactory

    Message: The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void .cctor()

    HelpLink: NULL

    Source: System.Data

    StackTrace Information

    ===================

    at System.Data.SqlClient.SqlConnection..cctor()

    3) Exception Information

    ===================

    Exception Type: System.TypeInitializationException

    TypeName: System.Data.SqlClient.SqlPerformanceCounters

    Message: The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception.

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void .ctor()

    HelpLink: NULL

    Source: System.Data

    StackTrace Information

    ===================

    at System.Data.SqlClient.SqlConnectionFactory..ctor()

    at System.Data.SqlClient.SqlConnectionFactory..cctor()

    4) Exception Information

    ===================

    Exception Type: System.Configuration.ConfigurationErrorsException

    Message: Configuration system failed to initialize

    BareMessage: Configuration system failed to initialize

    Filename: NULL

    Line: 0

    Errors: System.Configuration.ConfigurationException[]

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void EnsureInit(System.String)

    HelpLink: NULL

    Source: System.Configuration

    StackTrace Information

    ===================

    at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)

    at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)

    at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)

    at System.Configuration.ConfigurationManager.GetSection(String sectionName)

    at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)

    at System.Diagnostics.DiagnosticsConfiguration.Initialize()

    at System.Diagnostics.Switch.InitializeConfigSettings()

    at System.Diagnostics.Switch.InitializeWithStatus()

    at System.Diagnostics.Switch.get_SwitchSetting()

    at System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp)

    at System.Data.SqlClient.SqlPerformanceCounters..ctor()

    at System.Data.SqlClient.SqlPerformanceCounters..cctor()

    5) Exception Information

    ===================

    Exception Type: System.Configuration.ConfigurationErrorsException

    Message: An error occurred loading a configuration file: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config' is denied. (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config)

    BareMessage: An error occurred loading a configuration file: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config' is denied.

    Filename: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config

    Line: 0

    Errors: System.Configuration.ConfigurationException[]

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void ThrowIfErrors(Boolean)

    HelpLink: NULL

    Source: System.Configuration

    StackTrace Information

    ===================

    at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)

    at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()

    at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)

    6) Exception Information

    ===================

    Exception Type: System.UnauthorizedAccessException

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

    Data: System.Collections.ListDictionaryInternal

    TargetSite: Void WinIOError(Int32, System.String)

    HelpLink: NULL

    Source: mscorlib

    StackTrace Information

    ===================

    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

    at System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName)

    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions)

    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName)

    at System.Configuration.ClientConfigurationHost.OpenStreamForRead(String streamName)

    at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Viewing 15 posts - 1 through 15 (of 15 total)

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