Deletes a mail profile used by Database Mail.
Applies to: SQL Server (SQL Server 2008 through current version).
Deleting a profile does not delete the accounts used by the profile.
This stored procedure deletes the profile regardless of whether users have access to the profile. Use caution when removing the default private profile for a user or the default public profile for the msdb database. When no default profile is available, sp_send_dbmail requires the name of a profile as an argument. Therefore, removing a default profile may cause calls to sp_send_dbmail to fail. For more information, see sp_send_dbmail (Transact-SQL).
The stored procedure sysmail_delete_profile_sp is in the msdb database and is owned by the dbo schema. The procedure must be executed with a three-part name if the current database is not msdb.
The following example shows deleting the profile named AdventureWorks Administrator.
EXECUTE msdb.dbo.sysmail_delete_profile_sp @profile_name = 'AdventureWorks Administrator' ;