Skip to content
Advertisement

SQL Server 2008 – Email notifications

I have a SQL server / database locally and accessed through ip etc…

What I want to know is how to send emails directly from the server (when n happens)?

Advertisement

Answer

You can use Database Mail. To send e-mails via SQL Server you can use the following stored procedure:

sp_send_dbmail

EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Adventure Works Administrator',
@recipients = 'danw@Adventure-Works.com',
@body = 'The stored procedure finished successfully.',
@subject = 'Automated Success Message' ;

Or how to configure a SQL agent to send mail

http://msdn.microsoft.com/en-us/library/ms186358.aspx

Additional references

http://msdn.microsoft.com/en-us/library/ms190307.aspx

http://msdn.microsoft.com/en-us/library/ms177580.aspx

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement