SQL Flow Field Guide

sysmail_add_account_sp

Check SQL Server version support in the source

Creates a new Database Mail account holding information about an SMTP account.

What changes

Input
Not stated in the Microsoft summary.
Output or change
Creates a new Database Mail account holding information about an SMTP account.

Syntax at a glance

dbo.sysmail_add_account_sp
    [ @account_name = ] N'account_name'
    , [ @email_address = ] N'email_address'
    [ , [ @display_name = ] N'display_name' ]
    [ , [ @replyto_address = ] N'replyto_address' ]
    [ , [ @description = ] N'description' ]
    [ , [ @mailserver_name = ] N'mailserver_name' ]
    [ , [ @mailserver_type = ] N'mailserver_type' ]
    [ , [ @port = ] port ]
    [ , [ @username = ] N'username' ]
    [ , [ @password = ] N'password' ]
    [ , [ @use_default_credentials = ] use_default_credentials ]
    [ , [ @enable_ssl = ] enable_ssl ]
    [ , [ @account_id = ] account_id OUTPUT ]
[ ; ]

Work example

Creates a new Database Mail account holding information about an SMTP account.

Write a proposed call on paper. Name the target, required permission, expected change, and recovery step before any lab use.

Check your work What can this procedure change or start, and what permission does it need?

Open Microsoft Learn for full syntax, permissions, and details for your version.