Sending Mail

How to send mail from SQL Server?

Questions by sonudotnet   answers by sonudotnet

Showing Answers 1 - 3 of 3 Answers

With SQL Server 2005, there is no need to use MAPI client to send emails. Fellow developers who have used MAPI in the previous versions of SQL Server are well aware of the challenges it had.

However in Sql Server 2005, we can now use the Database Mail to send emails. [Note: I assume you have set up and configured Database Mail. If not, check this link Database Mail Configuration Stored Procedures to use various stored procedures required to configure Database Mail. As an alternative, you could also use the SQL Server Surface area configuration tool to configure Database Mail]

Use the following script to send a mail from your Sql Server
USE [YourDB]
EXEC msdb.dbo.sp_send_dbmail @recipients = 'admin @ xyz . com; xyz @ xyz . com; pqr @ xyz . com', @body = 'Just testing the mail', @subject = 'Sending Mail using Database Mail' ;
GO

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions