Delen via


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.

Note

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 iconTransact-SQL Syntax Conventions

Syntax

xp_stopmail

Return Code Values

0 (success) or 1 (failure)

Result Sets

xp_stopmail returns this message:

Stopped SQL mail session.

Remarks

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

Permissions

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.