Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 smtp sql mail with body > 8000 characters

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-21 : 08:07:35
Brett Levin writes "Hi SQL Team,

I really enjoyed a SQL Mail SMTP Stored procedure written by one of your gurus. It works perfectly but I have a problem though, how do you send a mail that is greater than 8000 characters long – considering that the max length of varchar(body) is 8000.

I would greatly appreciate any help.

Kind Regards,

Brett"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-04-21 : 08:15:17
Hi Brett

Glad you liked the article

The 255 character limit is a problem in SQL Server and a bit of a blunder of mine that I didn't catch it in the article.
There are a few ideas set out in the article comments, my favoured solution is to send the actuall mailing out to an external application. Something like this : http://www.sqlteam.com/item.asp?ItemID=5908

Does that help ?


Damian
Go to Top of Page

Blevin
Starting Member

3 Posts

Posted - 2003-04-22 : 05:06:17
quote:

Hi Brett

Glad you liked the article

The 255 character limit is a problem in SQL Server and a bit of a blunder of mine that I didn't catch it in the article.
There are a few ideas set out in the article comments, my favoured solution is to send the actuall mailing out to an external application. Something like this : http://www.sqlteam.com/item.asp?ItemID=5908

Does that help ?


Damian



Go to Top of Page

Blevin
Starting Member

3 Posts

Posted - 2003-04-22 : 05:10:12
Hi Damian

Thank you kindly for the reply.

I have had a look through the link you sent me and it seems as though all SQL sourced mail is limited by the varchar size. The current SMTP script works sensationally albeit the varchar limitation.

I need to send html mails from within SQL stored procedures, hence a vbscript is unfortunately not an option.

Any other ideas?

Would greatly appreciate any help.

Kind Regards,
Brett



Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-04-22 : 08:11:15
Hi

I have been told that SQL 2000 fixes the problem, but I haven't tested that. The other idea is maybe save the email in a table and write an executable program that takes the ID as a command line parameter and sends it.

Just a thought.

Damian
Go to Top of Page

Blevin
Starting Member

3 Posts

Posted - 2003-04-22 : 10:41:40
Hi Damian

The more I think about it, the more I reckon its gonna need a 3rd party mail system. The reason is that I need to loop through names and add variables etc...

Can you recommend any good mail programs that work well with SQL as a data source?

Thanks again.

Kind Regards,
Brett


Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-04-22 : 13:09:24
Hi

It's all doable
Tell me though, what constraints do you have ? You say that a small bit of vb script is out of the question, but you would consider a 3rd party app. Is that a technical limitation or a political one ?

Damian
Go to Top of Page
   

- Advertisement -