To Configure Database Mail you must create database mail account and profile.Following are the steps to configure Database Mail Account And Profile.
Once Account and Profile has been created you must configure database mail using sp_configure stored procedure
exec sp_configure 'show advanced options',1
Go
Reconfigure
go
sp_configure 'Database Mail XPs',1
go
Reconfigure
go
Now the database mail configuration is done. Lets send a test mail.
Or you can use following query to send database mail.
EXEC msdb.dbo.sp_send_dbmail @profile_name=’Demo Profile’,
@recipients='kuldeep@dbsimplified.com',
@subject='Demo Mail Sent Using T-SQL Query',
@body='This is test email sent from database mail using T-SQL Query’
No comments:
Post a Comment