Scenario:
Let's say we have a table which store Email To , Email From , Subject and Body of emails those we need to send on daily basis. We want to design an SSIS Package that runs on schedule and send email for each of the record that is stored in the Table.
Solution:
To solve above scenario, we will be using following components of an SSIS Package
- Read all the records from a table and stored in Object type variable by using Execute SQL Task
- Loop through Object type variable by using For-each Loop Container and store values in variables
- Write Expressions in Send Mail Task
CREATE TABLE dbo.Email ( id INT identity(1, 1) ,EmailFrom VARCHAR(100) ,EmailTo VARCHAR(100) ,Subject VARCHAR(100) ,Body NVARCHAR(MAX) ) GOINSERT INTO dbo.Email ( Emailfrom ,EmailTo ,Subject ,Body ) VALUES ( 'aamirsqlage@gmail.com' ,'techbrotherssqlage@gmail.com' ,'Test Subject1' ,' Hi This is email for Test1 Thank you Tech Brothers' ) INSERT INTO dbo.Email ( Emailfrom ,EmailTo ,Subject ,Body ) VALUES ( 'aamirsqlage@gmail.com' ,'techbrotherssqlage@gmail.com' ,'Test Subject2' ,' Hi This is email for Test2 Thank you Tech Brothers' ) INSERT INTO dbo.Email ( Emailfrom ,EmailTo ,Subject ,Body ) VALUES ( 'aamirwarraich2001@gmail.com' ,'techbrotherssqlage@gmail.com' ,'Test Subject3' ,' Hi This is email for Test3 Thank you Tech Brothers' ) SELECT EmailFrom ,EmailTo ,Subject ,Body FROM dbo.Email
Read Email information from SQL Server Table and Send Email by using Send Mail Task in SSIS Package - SSIS Tutorial
Related Posts/Videos on Send Mail Task
- Create Load Summary Email logic in SSIS Package
- How to Configure Send Mail Task and Send Email in SSIS Package
- Create a file with Date From SQL Server Table and Send as Attachment in SSIS Package
- Attach Multiple Files Dynamically in Send Mail Task in SSIS Package
- Send Error Email with Error Code, Error Description by using Send Mail Task in SSIS Package
- Send List of Files from A Folder as Email by using Send Mail Task
- Use Send Mail Task with Precedence Constraints in SSIS Package
- Read EmailTo,EmailFrom,Subject and Body From Text File and Send Emails by using Send Mail Task in SSIS Package
- Send Load Summary Email by using Send Mail Task in SSIS Package
The best Psoriasis creams are steroid creams, they help in the treatment of most skin condition. clenbuterol for sale
ReplyDeleteFantastic, Your post is an excellent example of why I keep coming back to read your excellent quality commentary…. see here now
ReplyDeleteWe'll discuss co-distributing and we'll examine roundabout mailing (you'll figure out how to get individuals to pay you money to mail their brochures for them!). millions of leads
ReplyDeleteThanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on, and I have been on the look out for such information. best testosterone supplements
ReplyDeleteYour eating routine ought to likewise incorporate satisfactory fiber and water so your stomach related framework/kidneys can adapt to the extra protein/carbs you're placing into your body. best place to buy ostarine
ReplyDeleteWhy do only so much written on this subject? Here you see more. cbd cream for pain
ReplyDeletePeople that currently have health insurance are going to be transitioned into these new plans sometime in 2014. So the insured will be directly affected by this because the health plans they have today are going away, and they will be mapped into a new ObamaCare plan in 2014. do bananas cause gas
ReplyDeleteIn fact, some of the carriers are now saying they anticipate that up to 50% of small groups with 10 or fewer employees are going to drop their health insurance plan sometime between 2014 and 2016. 50 mg cbd capsules
ReplyDeleteInterestingly you write, I will address you'll find exciting and interesting things on similar topics. Glownar
ReplyDeleteExtremely instructive post ! There is a great deal of data here that can enable any business to begin with a fruitful interpersonal interaction campaign ! Infinix Hot 9 Pro Price
ReplyDeleteThis is a great post I seen because of offer it. It is truly what I needed to see seek in future you will proceed after sharing such a magnificent post. مسلسلات رمضان 2022
ReplyDeleteOn my website you'll see similar texts, write what you think. Satta king 786
ReplyDeleteIf you win the game then you can win 80 to 90 times your amount. If you failed to win then all your amounts will be gone. There are various types of games available in Satta King. Choose accordingly and see Satta king fast result. Many people have tried their luck and they won the game.
ReplyDeleteGreat article. I love your writing style. It's inspirational and I truly appreciate it. Visit my website.
ReplyDeleteBlack satta king