Sunday, 21 October 2018

Send mail using execute sql task in SSIS

We can send the mail using execute SQL task in the package. For sending the mail we need to use sp_send_dbmail.
Before using Sp_send_dbmail we need to create a profile.

I have created a profile named [Bagi mail]
Sp_send_dbmail
EXEC msdb.dbo.sp_send_dbmail
 @profile_name = 'Bagi Mail',
 @recipients = 'bageshkumarbagimsbi@gmail.com',
 @body = 'Hello',
 @subject = 'Execute sql task',
 @exclude_query_output = 1

We can set profile name, recipients, and body and subject name using variables.
Now I am taking execute SQL task.
      
     
Creating the configure manager.
           
     
Click ok. Now I am running this package.
Package executed successfully.
     
       
Now we will see the mailbox.
     
     
See the mail body.
     



No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts