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?
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?