SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


XP_SendMail attachment error


XP_SendMail attachment error

Author
Message
karrenbennett
karrenbennett
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 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.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)SSC Guru (146K reputation)

Group: Administrators
Points: 146430 Visits: 19430
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
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search