Deletes a Database Mail SMTP account. You can also use the Database Mail Configuration Wizard to delete an account.
Applies to: SQL Server (SQL Server 2008 through current version).
This procedure deletes the account specified, regardless of whether the account is in use by a profile. A profile that contains no accounts cannot successfully send e-mail.
The stored procedure sysmail_delete_account_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 Database Mail account named AdventureWorks Administrator.
EXECUTE msdb.dbo.sysmail_delete_account_sp @account_name = 'AdventureWorks Administrator' ;