Posted in Development, Stored Procedure

Sysmail_help_Account_sp – SQL Server Database Mail Stored Procedure – Part 6

Hi friends, 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:

sysmail_help_account_sp [ [ @account_id = ] account_id | [ @account_name = ] ‘account_name’ ]


@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.

EXEC msdb.dbo.sysmail_help_Account_sp NULL, ‘DB_Email_Account’


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 🙂



I am Kapil Singh Kumawat working on SQL Server since last 5 years. I am from Jaipur, Rajasthan, India and currently working in Cognizant Technology Solutions as SQL Server Developer. I have a good experience in writing queries, performance tuning, SSIS, SSAS, Power BI, Data migration and database designing. Apart from database I have interest in travelling,watching football and listening music. My blogs are also published on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s