views:

371

answers:

1

Is this a bug, or some hidden limit I can't find any documentation about? When creating a Send Mail Task in SSIS 2008, the TO, CC and BCC fields seem to have a hidden limit of 255 characters. I'm aware this is the standard limit for individual email addresses, but all three are commonly used for multiple addresses and the comment for the To field even says "separate the recipients with semicolons". But nevertheless, it truncates the address to a maximum of 255 characters.

Bug, non-obvious standard, or something I'm missing? Any way around this? We were trying to build a CC list dynamically, but this has caused a rethink.

EDIT : After a little bit of Googling, I believe I've found the source of the standard referred to - it is RFC 2821 which says :

domain
The maximum total length of a domain name or number is 255 characters.

path
The maximum total length of a reverse-path or forward-path is 256 characters (including the punctuation and element separators).

+1  A: 

Strange, both Sql Server 2008 and 2005 state the following:

The To, Cc, and Bcc lines are limited to 256 characters each in accordance with Internet standards.

at the following address:
http://msdn.microsoft.com/en-us/library/ms142165.aspx

But I was able to use the following code to generate a ToLine like you were trying to do:

declare @toline varchar(8000)
set @toline = ' '

select @toline = @toline + EMAIL + ';' 
from Control.ControlPointMail where enabled = 1

select @toline = substring(@toline,1,len(@toline)-1)

select @toline  

The execute SQL task that runs this code puts it into a variable.
The variable is referenced in an expression for the to line of a send mail task.

I think that I would interpret the text from MSDN to be that the input field for the To, CC, and BCC lines are limited to 256 characters on the assumption that you would only be inputting one address at a time to that field.

William Todd Salzman
Another odd thing is that the IDE actually limits you to 255, not 256 as the link states.
CodeByMoonlight

related questions