473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

xp_sendmail with long text messages

Hi everybody,

i try to send messages longer than 7990 characters from a text field
in SSQL2000. Unfortunatly the messages get cut off after 7990
character.

I did everything which is described in BOL (see below). It does not
solve the problem. Upgraded to newest Outlook Client and tried to send
as an attachment also. No success though.

Does anybody have a hint before i contact Microsoft.

Regards
Yorn Ziesche
E. Send messages longer than 7,990 characters

This example shows how to send a message longer than 7,990 characters.
Because message is limited to the length of a varchar (less row
overhead, as
are all stored procedure parameters), this example writes the long
message
into a global temporary table consisting of a single text column. The
contents of this temporary table are then sent in mail using the
@query
parameter.

CREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put your long message here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 FROM ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header= 'TRUE'
DROP TABLE ##texttab
Jul 20 '05 #1
3 4328
Hi

This is documented in BOL as 8000:
[@message =] 'message'

Is the message to be sent. message can be up to 8,000 bytes.

See:
mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
lref.chm::/ts_xp_aa-sz_6hbg.htm

At a guess you also have some control characters to give 7990.

You may want to use attachments or xp_smtp
http://www.sqldev.net/xp/xpsmtp.htm

John

"Yorn Ziesche" <y.*******@vhb.de> wrote in message
news:df**************************@posting.google.c om...
Hi everybody,

i try to send messages longer than 7990 characters from a text field
in SSQL2000. Unfortunatly the messages get cut off after 7990
character.

I did everything which is described in BOL (see below). It does not
solve the problem. Upgraded to newest Outlook Client and tried to send
as an attachment also. No success though.

Does anybody have a hint before i contact Microsoft.

Regards
Yorn Ziesche
E. Send messages longer than 7,990 characters

This example shows how to send a message longer than 7,990 characters.
Because message is limited to the length of a varchar (less row
overhead, as
are all stored procedure parameters), this example writes the long
message
into a global temporary table consisting of a single text column. The
contents of this temporary table are then sent in mail using the
@query
parameter.

CREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put your long message here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 FROM ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header= 'TRUE'
DROP TABLE ##texttab

Jul 20 '05 #2
John,

BOL explicitly states a way to send messages longer than 7990 Bytes (example
below).
I thought this is related to the length of the resultset.

Yorn
"John Bell" <jb************@hotmail.com> schrieb im Newsbeitrag
news:sC*******************@news-text.cableinet.net...
Hi

This is documented in BOL as 8000:
[@message =] 'message'

Is the message to be sent. message can be up to 8,000 bytes.

See:
mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq lref.chm::/ts_xp_aa-sz_6hbg.htm

At a guess you also have some control characters to give 7990.

You may want to use attachments or xp_smtp
http://www.sqldev.net/xp/xpsmtp.htm

John

"Yorn Ziesche" <y.*******@vhb.de> wrote in message
news:df**************************@posting.google.c om...
Hi everybody,

i try to send messages longer than 7990 characters from a text field
in SSQL2000. Unfortunatly the messages get cut off after 7990
character.

I did everything which is described in BOL (see below). It does not
solve the problem. Upgraded to newest Outlook Client and tried to send
as an attachment also. No success though.

Does anybody have a hint before i contact Microsoft.

Regards
Yorn Ziesche
E. Send messages longer than 7,990 characters

This example shows how to send a message longer than 7,990 characters.
Because message is limited to the length of a varchar (less row
overhead, as
are all stored procedure parameters), this example writes the long
message
into a global temporary table consisting of a single text column. The
contents of this temporary table are then sent in mail using the
@query
parameter.

CREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put your long message here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 FROM ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header= 'TRUE'
DROP TABLE ##texttab


Jul 20 '05 #3
Hi

Sorry I didn't read to the bottom of the message..

Unfortunately I can't check this out at the moment, but other posts indicate
that attachments are not needed, therefore I assume that it does work on the
latest service packs.

John

"Yorn Ziesche" <y.*******@vhb.de> wrote in message
news:3f*********************@businessnews.de.uu.ne t...
John,

BOL explicitly states a way to send messages longer than 7990 Bytes (example below).
I thought this is related to the length of the resultset.

Yorn
"John Bell" <jb************@hotmail.com> schrieb im Newsbeitrag
news:sC*******************@news-text.cableinet.net...
Hi

This is documented in BOL as 8000:
[@message =] 'message'

Is the message to be sent. message can be up to 8,000 bytes.

See:

mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
lref.chm::/ts_xp_aa-sz_6hbg.htm

At a guess you also have some control characters to give 7990.

You may want to use attachments or xp_smtp
http://www.sqldev.net/xp/xpsmtp.htm

John

"Yorn Ziesche" <y.*******@vhb.de> wrote in message
news:df**************************@posting.google.c om...
Hi everybody,

i try to send messages longer than 7990 characters from a text field
in SSQL2000. Unfortunatly the messages get cut off after 7990
character.

I did everything which is described in BOL (see below). It does not
solve the problem. Upgraded to newest Outlook Client and tried to send
as an attachment also. No success though.

Does anybody have a hint before i contact Microsoft.

Regards
Yorn Ziesche

>E. Send messages longer than 7,990 characters
This example shows how to send a message longer than 7,990 characters.
Because message is limited to the length of a varchar (less row
overhead, as
are all stored procedure parameters), this example writes the long
message
into a global temporary table consisting of a single text column. The
contents of this temporary table are then sent in mail using the
@query
parameter.

CREATE TABLE ##texttab (c1 text)
INSERT ##texttab values ('Put your long message here.')
DECLARE @cmd varchar(56)
SET @cmd = 'SELECT c1 FROM ##texttab'
EXEC master.dbo.xp_sendmail 'robertk',
@query = @cmd, @no_header= 'TRUE'
DROP TABLE ##texttab



Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeff Cochran | last post by:
Does anyone have a code snippet or example on using the xp_sendmail SQL procedure from an ASP page (VBscript)? I have no problem with the stored procedure from a query and I think my problem is...
2
by: Jürgen Hetzel | last post by:
Hello! My environment is: Win 2000 Server, MS SQL-Server 2000 (SP2) and MS ExchangeServer 5.5 the two following TransactSQL-codepieces show different results: 1. with attachment
0
by: Yorn Ziesche | last post by:
Hi there, when i try to send large text messages (>7990 characters) text gets cut off after 8 KB. This problem is described in BOL and i used the suggested workaround with creating a temp table...
6
by: Nathan Griffiths | last post by:
I have been testing our SQL Mail setup in SQL Server 2000 (sp3a) and have found that when I attach results as a file, every other character is a control character which causes each real character...
6
by: Rolf Kemper | last post by:
Dear All, we are running SQL2000 Sever and make use of the xp_sendmail. For any reason the mail service can run into problems and it looks like that the statemnt below gets not finished. ...
1
by: mike | last post by:
Using the Query Analyzer, I issued the statement "EXEC xp_sendmail 'anyone@hotmail.com, 'Test.'" and received 'email sent' confirmation. But, my email was never received. I used the same...
1
by: Michael McGarrigle | last post by:
I would like to send the contents of a file using xp_sendmail however I do not want the file contents to be an attachment. I have no problem sending the file as an attachement. Can anybody give me...
2
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have...
0
by: Slawomir Nasiadka | last post by:
Hi, I'am new to this group so I would like to say "Hello" everyone and here is my problem: I'm writing a simple application (code is at the end of this message) witch would list all mails...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.