Using SSIS Script Task for sending HTML embeded report
Hi I'm using SSIS 2008 Script Task to send an HTML (refering to SSRS report). I would like the email will be received with report embeded in email body. I would like also that the rendering will be by the receiver. pls help. I'm attaching my VB script below. Thanks. p.s: how to set multi email adddresses derived from db table set in BCC? Dim myHtmlMessage As MailMessage Dim mySmtpClient As SmtpClient Dim strPageScript As String '1st try using a href: 'strPageScript = "<table> <tr><td>hello !!!! </td></tr> <tr> <td> <a href='http://<MyServerName>/sites/BBI/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/sites/BBI/Reports/PRI%20Project/RS_LAK_MAIL.rdl&Source=http%3A%2F%2Fvm%2Dbisps01%2Fsites%2FBBI%2FReports%2FForms%2Fupdated%2Easpx%3FRootFolder%3D%252Fsites%252FBBI%252FReports%252FPRI%2520Project%26FolderCTID%3D0x012000C2185D740B44874981D6B9E86D0F2008%26TreeField%3DFolders%26TreeValue%3DPRI%2520Project&DefaultItemOpen=1' > mj,kj</a></td></tr></table>" '2nd try using iframe: strPageScript = "<html xmlns=""http://www.w3.org/1999/xhtml"" ><head> <title>Untitled Page</title> </head> <htm <body> <iframe src=""http://<MyServerName>/sites/BBI/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/sites/BBI/Reports/PRI%20Project/RS_LAK_MAIL.rdl&Source=http%3A%2F%2Fvm%2Dbisps01%2Fsites%2FBBI%2FReports%2FForms%2Fupdated%2Easpx%3FRootFolder%3D%252Fsites%252FBBI%252FReports%252FPRI%2520Project%26FolderCTID%3D0x012000C2185D740B44874981D6B9E86D0F2008%26TreeField%3DFolders%26TreeValue%3DPRI%2520Project&DefaultItemOpen=1"" height=""780px"" width=""100%""></iframe> </body> </html>" myHtmlMessage = New MailMessage(sender@address.com, _ receiver@address.com, "Subject", strPageScript) mySmtpClient = New SmtpClient("smtp.server.com") myHtmlMessage.IsBodyHtml = True mySmtpClient.Credentials = CredentialCache.DefaultNetworkCredentials mySmtpClient.Send(myHtmlMessage) Dts.TaskResult = ScriptResults.Success
July 3rd, 2011 4:16am

You haven't told us what the problem is. Is the email not sending? Is the email body not rendered?Jeff Wharton MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA Blog: Mr. Wharty's Ramblings MC ID: Microsoft Transcript Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2011 4:31am

I don't believe you can do this because you have no control over the email system being used to receive your email. That said, it appears you are using SSRS in your code. You may get better assistance if your question is moved to the Reporting Services forum http://social.msdn.microsoft.com/Forums/en-AU/sqlreportingservices/threadsJeff Wharton MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCITP, MCDBA Blog: Mr. Wharty's Ramblings MC ID: Microsoft Transcript Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker
July 3rd, 2011 5:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics