all groups > sql server (alternate) > december 2003 >
You're in the

sql server (alternate)

group:

xp_sendmail with long text messages


xp_sendmail with long text messages y.ziesche NO[at]SPAM vhb.de
12/29/2003 2:00:40 AM
sql server (alternate):
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

[quoted text, click to view]
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'
Re: xp_sendmail with long text messages John Bell
12/29/2003 10:46:48 AM
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%20Server\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



[quoted text, click to view]

Re: xp_sendmail with long text messages Yorn Ziesche
12/29/2003 1:50:35 PM
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" <jbellnewsposts@hotmail.com> schrieb im Newsbeitrag
news:sCTHb.805$h53.6449366@news-text.cableinet.net...
[quoted text, click to view]

Re: xp_sendmail with long text messages John Bell
12/29/2003 3:21:27 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button