March 30, 2010 at 6:52 am
Hi all,
I'm hoping you can help. I have an ssis package that at the end of its process dynamically builds an email body and sends it to a list of people as notifcation of what has been loaded etc.
I am doing this by firstly building an long string in an "Execute SQL Task" object (I declare a varchar(8000) variable and build a the string recursivly using a select etc) and then I select it out as an "Result set" into a user variable, of type string, that I have created.
I then simply have set the "MessageSourceType" to variable and the "MessageSource" to my populated variable from the previous step for my send mail task.
The issue is where the content of the email (variable) exceeds around 4000 characters it gets truncated when it arrives in
I've read that the SSIS variables dont have a limit as such and the SQL code is using a varchar 8000 so all I can asume is that its getting truncated either of the "Result Set" allocation to the variable or in the "EmailSource" section
Can anyone shed some light on this and offer potential solution / work around?
Many Thanks
Dave
March 30, 2010 at 1:01 pm
You could try sending all the variables into a script task and sending the mail from there. It also might be able to give you more insight into where the truncation is occuring. you can use this as a starting point for a script:
'Code to send mail for SSIS:
Dim _oSMTPClient As New SmtpClient("smtpmailhost.yourcompany.com")
Dim _oMailMsg As New MailMessage()
_oMailMsg.From = New MailAddress("someemailaddress@yourcompany.com")
_oMailMsg.To.Add("someotheremailaddress@yourcompany.com")
_oMailMsg.Subject = "The Subject"
_oMailMsg.Body = "Message Body"
_oSMTPClient.Send(_oMailMsg)
Don't forget:
Imports System.Net.Mail
CEWII
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply