Problem

 

When trying to send emails from SQL Server using using the sp_send_dbmail stored procedure the following errors can appear:

 

Msg 14636, Level 16, State 1, Procedure sp_send_dbmail, Line 107

No global profile is configured. Specify a profile name in the @profile_name parameter.

or

Msg 15404, Level 16, State 19, Procedure xp_logininfo, Line 62

Could not obtain information about Windows NT group/user ?DOMAIN\user_name?, error code 0x5.

 

This happens on SQL Server 2005 or 2008 even if the Database Mail feature is installed and configured (the Database Mail feature is enabled and the necessary account and profile is created).

 

 

Cause

This happens because there is no database mail profile set as "Global Profile".

 

...

Solution:

Right click on the Database Mail in Management Studio and select the Configure Database Mail menu option.

 

 

Choose Manage profile security

 

Go to Public Profiles, select your profile name and then choose Yes in the Default Profile tab.

 

You can test that everything works fine by using the following code:

EXECUTE msdb.dbo.sp_send_dbmail
@recipients = 'user_name@companyname.com',
@Subject = 'Test Message generated from SQL Server DatabaseMail',
@Body = 'This is a test message from SQL Server DatabaseMail'

 

 


No feedback yet