After installing and configuring Database Mail on SQL 2005 or SQL 2008, when you try to send an email using msdb.dbo.sp_send_dbmail you get an error message as follows:
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
This is caused because none of the database mail profiles you created were set to be the "Global Profile".
Use one of the following methods to configure a default or "Global" email profile
Method 1: Configure a Default or Global Database Mail profile with the Wizard
Connect to the target SQL Server with SSMS (SQL Server Management Studio)
Expand the Management section
Right-click on Database mail and select Configure Database Mail
From the Wizard, click on
From the Task screen, select Manage Profile Security and click on
From the Manage Profile Security screen, select the target profile, then click in the Default Profile tab to activate the drop-down.
Select Yes fromt the drop-down then click on
From the Complete the Wizard screen, click on
Method 2: Configure a Default or Global Database Mail profile with [sysmail_update_principalprofile_sp]
To display or verify the status Database Mail profiles, execute the following stored procedure from within SSMS:
exec msdb.dbo.sysmail_help_principalprofile_sp
As you can see, the is_default for all the profiles is set to 0.
This means that NONE of the profiles is set as the default or global profile.
To configure a profile as the default/global one, execute the following stored procdure, specifying the appropriate parameters:
You can now verify that the profile has been configured as the Global or Default Database Mail Profile