Do you know how to send email from database?
Submitted by: AdministratorSQL Server has a feature for sending mail. Stored procedures can also be used for sending mail on demand. With SQL Server 2005, MAPI client is not needed for sending mails.
The following is the process for sending emails from database.
- Make sure that the SQL Server Mail account is configured correctly and enable Database Mail.
- Write a script to send an e-mail. The following is the script.
USE [YourDB]
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'xyz@xyz.com; xyz@xyz.com;abc@edf.com'
@body = ' A warm wish for your future endeavor',
@subject = 'This mail was sent using Database Mail' ;
GO
Submitted by: Administrator
The following is the process for sending emails from database.
- Make sure that the SQL Server Mail account is configured correctly and enable Database Mail.
- Write a script to send an e-mail. The following is the script.
USE [YourDB]
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'xyz@xyz.com; xyz@xyz.com;abc@edf.com'
@body = ' A warm wish for your future endeavor',
@subject = 'This mail was sent using Database Mail' ;
GO
Submitted by: Administrator
Read Online SQL Database Concepts Job Interview Questions And Answers
Top SQL Database Concepts Questions
☺ | Explain what are Magic tables in SQL Server? |
☺ | Do you know how to send email from database? |
☺ | How to search for a string in all stored procedure in SQL Server? |
☺ | Explain how to use Linked Server? |
☺ | Explain difference between cross join and Full outer join? |
Top New MS SQL Server Categories
☺ | SQL Server Database Administrator Interview Questions. |
☺ | SQL Server Service Broker Interview Questions. |
☺ | SQL Server Locks Interview Questions. |
☺ | SQL Server Constraints Interview Questions. |
☺ | MS SQL Data Mining Interview Questions. |