email query result ssis

There is a table that I want to select and send it to email recipient n outlook….how to do that in SSIS?
  FROM [dummyDB].[dbo].[2013_oldDataTbl]
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dheeraj BabooTeam LeadCommented:

SET @tableHTML =
   N'<head>' +
    N'<style type="text/css">h2, body {font-family: Arial, verdana;} table{font-size:11px; border-collapse:collapse;} td{background-color:#F1F1F1; border:1px solid black; padding:3px;} th{background-color:#99CCFF;}</style>' +
   N'<h2><font color="#0000ff" size="4">Test Report</font></h2>' +  
   N'</head>' +
N'<body>' +
N' <hr> ' +
N' ' +
    N'<table border="1">' +
            N'<th>Brands</th>' +
            N'<th>Fiscal Month</th>'+
    </tr>' +
      CAST ( ( SELECT td = Pl,       '',
                    td = Brnds, '',
                    td = fiscalMonth, '',
                    td = Dollars, ''
              FROM [dummyDB].[dbo].[2013_oldDataTbl]
              FOR XML PATH('tr'), TYPE
    ) AS NVARCHAR(MAX) ) +
    N'</table>' ;

EXEC msdb.dbo.sp_send_dbmail @recipients='',
    @profile_name = 'SQl',
    @subject = 'Test Report',
    @body = @tableHTML,
    @body_format = 'HTML' ;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.