Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

XP_SendMail attachment error Expand / Collapse
Author
Message
Posted Friday, November 2, 2007 9:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 2, 2007 10:28 AM
Points: 1, Visits: 3
We’ve been using XP_SendMail with no issues just recently.
There is a stored procedure which produces a table and attaches the table to an email. This has been working perfectly for the last year or so but this month the file apparently has gotten too bigand produces the following error:

Server: Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80004005

The attached file is approximately 10 MB. I can change the QRY to limit the number of records to less than 22,000 and it works fine. I’ve also looked at the data to make sure there is no ‘unusual’ stuff hanging around.

We are using: Miscrosoft SQL Server 2000 ver 8.00.2039

So my question is: Is there an attachment size limit on XP_SendMail?
The sysadmin has reviewed Exchange and there is no size limit on this account.

Any suggestions?


This is the procedure:



DECLARE @strQuery varchar(2000), @strMessage varchar(200)

set @strQuery = '
USE Goldmine_gacs
SET CONCAT_NULL_YIELDS_NULL OFF

select DB1. accountno, DB2.contact, db2.lastName,
DB3.email, DB1.key1 as status
FROM DB1
INNER JOIN DB2
on DB1.accountno = DB2.accountno
INNER JOIN DB3
on DB1.accountno = DB3.accountno
WHERE substring(DB1.key1,2,1) in (2,3,4,5,6)
and (DB3.contact = ''E-Mail Address''
and substring(DB3.zip,2,1) = ''1'' )

SET CONCAT_NULL_YIELDS_NULL ON
'

EXEC master..xp_sendmail @recipients = 'name@location.city',

@query = @strQuery,
@subject = 'Enter subject here',
@message = 'Enter message here',
@attach_results = 'TRUE', @width = 250
GO





Thanks.

Post #418010
Posted Friday, November 2, 2007 10:27 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 8:25 PM
Points: 31,279, Visits: 15,740
If there's a size issue, I'd think it would be with Exchange. Can you send the file from your account with no issues? Can you log into the server with the SQL Server service account and send it from Outlook?

If anything, I'd think the size causes some type of timeout.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #418044
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse