Hi friends, in previous blog of SQL Server system stored procedure we created database mail account. In this blog we will learn how to get information about database mail account using stored procedure sysmail_hep_account_sp.

Sysmail_help_account_sp stored procedure displays information about database mail account.

When the procedure executes without passing any parameters then it will display all database accounts information.

Syntax of sysmail_help_account_Sp is as follows:


@account_id – Account Id of the database mail account.

@account_name – Account name of the database mail account.

Let’s execute the stored procedure to get the information of the database mail account which we created in our previous blog here. Here we define the account name in the parameter list.


After executing the stored procedure we will get the following columns in the result set:

Account_Id – Account Id with datatype Int.

Name – Account Name with datatype sysname.

Description – Description of the account having datatype nvarchar(256).

Email_address – Email address of the sender having datatype nvarchar(128).

Display_name – Display name of the account having datatype nvarchar(128).

Replyto_address – The address where replies to message are sent.

Servertype – Type of email server for mail account.

Servername – Name of email server

Port – Port number of email server

Username – Username to use login to email server.

User_default_credentials – Specifies whether to send the email using SMTP server using credentials of SQL Server database engine.

Enable_ssl – Specifies whether Database email encrypts communication using SSL.

That’s all for the day friends. We will continue with other database mail stored procedures in next blogs. Have a happy learning :)