Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_SendMail Error

Status
Not open for further replies.

JonathanC

Programmer
Oct 24, 2001
35
0
0
US
declare @file nvarchar(300)

set @filename = ' \\'+@@servername+'\bi\acctTest\BofaPPay\' + convert(varchar(20), getdate(),12)+ substring(convert(varchar(10),getdate(),8),1,2) + substring(convert(varchar(10),getdate(),8),4,2) + substring(convert(varchar(10),getdate(),8),7,2) + '.txt'

set @sql = 'master..xp_cmdshell ''bcp '+db_name()+'.' + user + '.ppTable ' +' out ' + @filename +' -c -S '+@@servername+' '',no_output'

exec sp_executesql @sql

exec master..xp_SendMail @recipients = 'myname@myhost.com',@subject='The subjectmatter',@attachments = @filename

--I am trying to put a table to a file and send the created file as an attachment using xp_sendmail configured to MS Exchange 5.5. I got the following error:

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

-- On Microsoft SQL Server site in microsoft.com, they considered this as a problem with ms exchange 2000 active directory...but i have nothing to do with that since we're running 5.5. Any guesses?
 
see microsoft knowledgebase article #Q274330
Chris
LAN Admin / Programmer
cjoseph@hdii.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top