adding custom message text to ssis script task
This is the code to send out an email in ssis script task. How do I add custom message to it. I am using Dim varMessageText As String but does not help. Public Sub Main() Dim varSMTPClient As SmtpClient Dim varMailBody As Object Dim varAddresses As MailAddress Dim varReplyAdd As MailAddress Dim varMessageText As String Using varHTMLMAIL As New MailMessage("xyz@xyz.com", "abc@xyz.com") varHTMLMAIL.IsBodyHtml = True varMailBody = Dts.Variables("Result").Value varHTMLMAIL.Subject = "Report Email" varMessageText = "*Note: Report for Current Week" varHTMLMAIL.Body = varMailBody varSMTPClient = New SmtpClient("smtp") varSMTPClient.UseDefaultCredentials = True varSMTPClient.Send(varHTMLMAIL) End Using Dts.TaskResult = Dts.Results.Success End Sub End Class Thanks
March 28th, 2011 9:59pm

Use the overloaded, New MailMessage(from As String, To As String, subject As String, body As String)Chaos, Disorder and Panic ... my work is done here!
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2011 10:07pm

Isn't this SmtpMail question for the VB.net forum? Or is there a connection to SSIS (other then this is a SSIS Script Task)? Other option: http://msdn.microsoft.com/en-us/library/ms142165.aspx Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
March 28th, 2011 10:14pm

Thanks for the reply. Do I have to use a overload function? Public Overloads Function New MailMessage(from As String, To As String, subject As String, body As String) As String
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2011 10:36pm

Fixed it thanks..........
March 29th, 2011 5:38am

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

Other recent topics Other recent topics