473,756 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_s endmail 'robertk',
@query = @cmd, @no_header= 'TRUE'
DROP TABLE ##texttab
Jul 20 '05 #1
3 4356
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%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\ts q
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.goo gle.com...
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_s endmail '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******** ***********@new s-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%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\ts q 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.goo gle.com...
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_s endmail '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******** *************@b usinessnews.de. uu.net...
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******** ***********@new s-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%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\ts q
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.goo gle.com...
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_s endmail '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
1297
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 getting the parameters passed to the procedure correctly, or just in using stored procedures from ASP. I can execute this SQL from Query Analyzer fine: xp_sendmail "testuser", "Hello World!"
2
23651
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
445
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 and using the query option of xp_sendmail. I tried to attach the message and even installed the latest Outlook XP Client. Nothing helped, the text gets cutt off.
6
2472
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 output on a separate line. I have no idea why this is happenening, I've never seen it before. The code looks like this; EXEC master.dbo.xp_sendmail @recipients = '<email address>', @dbuse = 'TestDB',
6
2486
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. EXEC @Status = master..xp_sendmail @recipients=@TOList, @copy_recipients=@CCList,@subject='the subject goes here',@message=@MailText,@no_output=TRUE
1
1664
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 statement to send mail to a Yahoo account and it was received. Is there a way to be able to send email using SQL xp_sendmail to a Hotmail account?
1
3007
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 an xp_sendmail example of how to do this. The results of a query can easily appear in the body of the email but all my attempts to include the contents of a file in the body of the email have not worked. TIA
2
3150
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 tried the following: 1)Checking SQL and SQLAgents accounts all match up with default mail profile.
0
2206
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 from a directory from Outlook Express. I have: - OE 6.0 - .NET Framework 1.1 - interface definition language for OE 6.0 - msoeapi.idl
0
10014
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9819
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7226
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6514
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5119
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5289
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3780
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2647
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.