xp_stopmail (Transact-SQL)

Stops a SQL Mail client session. Stopping a mail session opens the MAPI client components and logs off of the e-mail server.


This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Topic link icon Transact-SQL Syntax Conventions


0 (success) or 1 (failure)

xp_stopmail returns this message:

Stopped SQL mail session.

If there is no existing SQL Server mail session to stop, an error message is returned.

Requires membership in the sysadmin fixed server role, but EXECUTE permission can be granted to other users. However, for security reasons, we recommend that permissions for this stored procedure be limited to members of the sysadmin fixed server role.

Community Additions