Xp_smtp Extended Stored Procedure For MS SQL
Version: 4.1
Requirements: MS SQL Server
File Size: 229 KB
License: Free to Try
This application uses the MS SQL Server extended stored procedure xp_smtp to send email messages. To send email
messages using this procedure you do not need to create a mail profile for the user account that is used to start
an instance of the MS SQL Server. As well, it is not required to have any email clients installed. The extended
procedure allows you to send HTML formatted messages.
Copy the xp_smtp.dll over to your SQL Server \Binn directory.
Add your new Extended Stored Procedure from a Visual Studio Data Project, or
using the SQL Server Enterprise Manager, or by executing the following SQL command:
sp_addextendedproc 'xp_smtp', 'xp_smtp.dll'
exec master..xp_smtp{[@server =] 'server'
[,[@port =] 'server port number']
[,[@user =] 'user name']
[,[@pwd =] 'user password']
,[@recipients =] 'recipients [;...n]'
,[@from =] 'from' }
[,[@copy_recipients =] 'copy_recipients [;...n]'
[,[@blind_copy_recipients =] 'blind_copy_recipients [;...n]'
[,[@subject =] 'subject']
[,[@message =] 'message']
[,[@type =] 'type']
[,[@attachments =] 'attachments [;...n]']
Parameters:
[@server =] 'server'
- The SMTP server name or IP address.
[@port =] 'server port number'
- The SMTP server port number. Default value is 25.
[@user =] 'user name'
- The user.
[@pwd =] 'user password'
- User's password.
[@recipients =] 'recipients [;...n]'
- The semicolon-separated list of the recipients of the mail.
[@from =] 'from'
- The sender of the mail.
[@copy_recipients =] 'copy_recipients [;...n]'
- The semicolon-separated list identifying the recipients of a copy of the mail (cc).
[@blind_copy_recipients =] 'blind_copy_recipients [;...n]'
- The semicolon-separated list identifying recipients of a blind copy of the mail (bcc).
[@subject =] 'subject'
- The parameter specifying the subject of the email.
[@message =] 'message'
- The message to be sent. The message can be up to 2Gb.
[@type =] 'type'
- The input message type. Only "text/plain" and "text/html" are valid.
[@attachments =] 'attachments [;...n]'
- A semicolon-separated list of files to attach to the email message.
You may drop the extended stored procedure by using the SQL command:
sp_dropextendedproc 'xp_smtp'
You may release the DLL from the Server (to delete or replace the file), by using the SQL command: