On SQL 2005 you have to tell SQL Server Agent / Properties / Alert System, which profile that you'd like to enable. Here's what it does.
e.g. and don't forget to restart SQL Agent.
USE [msdb]
GO
EXEC master.dbo.xp_instance_regwrite
N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent',
N'DatabaseMailProfile',
N'REG_SZ',
N'MyDatabaseProfile'
GO
| Please refer MSDN To set up SQL Server Agent Mail to use Database Mail -
In Object Explorer, expand a server. -
Right-click SQL Server Agent, and then click Properties. -
Click Alert System. -
Select Enable Mail Profile. -
In the Mail system list, choose Database Mail. -
In the Mail profile list, select a mail profile for Database Mail. |