.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> SQL Query >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Send Mail in SQL Server 2008

Posted By:Sasi Prabhu       Posted Date: June 16, 2011    Points: 40    Category: SQL Query    URL: http://www.dotnetspark.com  

Sending Mail from SQL Server 2008.
 


Sending Mail via SQL Server 2008.

Configure DatabaseMail.

Perform Reconfigure as

sp_CONFIGURE 'show advanced', 1 
GO
 RECONFIGURE 
GO 
sp_CONFIGURE 'Database Mail XPs', 1 
GO
 RECONFIGURE 
 GO 


To Send Mail :

USE msdb
  GO
  sp_send_dbmail @profile_name='DatabaseMail_ProfileName',
  @recipients='XXXXXXXX@yourdomain.com',
  @subject='Test message',
  @body='This is the body of the test message. Congrates Database Mail Received By you Successfully.'



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend