How to Send Email Using Send Mail Task of SSIS

Step 1: Create a SSIS Package say SendMailTaskDemo

Step 2: Drag and drop a Send Mail Task Item from Control Flow Items

1-small.gif 

Step 3: Right click on the Connection Manager pane and Select New Connection

2.gif 

Step 4: Select SMTP connection manager and then click Add button.

3.gif

Step 5: Enter Name, Description and IP of the SMTP Server and then click OK.

4.gif

Step 6: Now Right click on the Send Mail Task Item and Select Edit.

5.gif

Step 7: Go to Mail tab of Send Mail Task Editor and then Select SMTP Connection Manager (the name of the SMTP connection manager) in the SmtpConnection and also enter the From, To, Cc, BCc, Subject etc fields.

6.gif

There are three types of Message Source Type : Direct Input, File Connection or Variable.

Direct Input - The message you type in the Message Source will be the body of the Mail.

File Connection - the content of the message will come from any file which will become the body  of the mail.

Variable - the content of the message will come from any SSIS variable which will become the body   of the mail.

Here we chose Direct Input

Step 8: You can also set the Priority : low,High or normal(default) and any attachments.

7.gif
 
Click Ok to finish.

Run the Send Mail task to Send the mail to whom u want !!

All queries are welcome !!

Up Next
    Ebook Download
    View all
    Learn
    View all