Starts a SQL Server mail client session.
xp_startmail ['user'] [, 'password']
where
If user and password are provided, SQL Server attempts to log on to Windows NT Mail (or other MAPI provider) using that username and password. If user and password are provided but are incorrect, an error message is returned. If no user or password are provided, SQL Server uses the username and password specified in SQL Setup, using the Mail Login dialog box under Server Options.
If there is an existing mail session, xp_startmail will not start a new one. If mail is being used on the same computer on which SQL Server is also running, the mail client must be started before xp_startmail is used or before SQL Server (if using the Set Server Options "Auto Start Mail Client" option found in SQL Setup). For more information, see the Microsoft SQL Server Administrator's Companion.
This example starts mail using the username and password specified in SQL Setup.
xp_startmail
This example starts mail using the username mailuser and the password abc12345.
xp_startmail 'mailuser', 'abc12345'
Execute permission defaults to the system administrator, who can grant permission to other users.
sp_processmail | xp_readmail |
xp_deletemail | xp_sendmail |
xp_findnextmsg | xp_stopmail |