Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Database Mail - 1,024 character being dropped

Status
Not open for further replies.

NewbieWithSQL

Programmer
May 25, 2011
10
0
0
US
I don't know if I'm in the right forum.

I'm creating dynamic HTML emails with SQL and sending it through SQL Database mail. I'm using select statement to create the HTML code and the results of the record pull from whatever table I'm querying...
When I send the email, via msdb.dbo.sp_send_dbmail to a SMTP relay on my IIS server. I get the email, however, the 1,024th character is dropped and then drops every 1,024 thereafter.

Has anyone come across this issue and have a solution.

Using the following test code, if needed

declare @Test varchar(2000)

set @Test = replicate('0123456789', 103)

if you were to send the variable @Test as the body of the email, you will see that the number 2 of the last set of numbers is dropped and picks up at the number 3 on a new line...

Thanks in advance
 
Don't think so... It still sends the email even if longer than 1024 characters, it just drops that whatever data is in that spot and then continues with the rest of the message.
 
I don't know what else would be needed, since everyone mail profiles are different

Here is some simple code, that I have used to test after seeing the issue.

declare @Test varchar(2000)

set @Test = replicate('0123456789', 103)

exec msdb.dbo.sp_send_dbmail
@profile_name = 'Default'
, @Recipients = 'youremailaddresss'
, @Body = @Test
, @Body_Format = 'HTML'

The email that I receive, via Outlook 2007, has a break on the last set of numbers. It shows the '01' and then a line break and picks up with '3456789'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top