September 15, 2012 at 4:30 pm
hi,
below is the script i have in SQL Server Agent.
SET ROWCOUNT 0
EXEC msdb..sp_send_dbmail
@profile_name = 'SQL Mail',
@recipients = '<me@email.com>',
@subject = 'subject',
@body = 'Please see attached report',
@file_attachments = 'D:\MSSQL10.MSSQLSERVER\MSSQL\Log\output_report_3.txt'
--@query = 'sp_helpdb userdb',
--@execute_query_database = 'MSDB',
--@query_result_separator = ',',
go
the job completes successfully but does not send an email. there are no errors generated.
when i comment out @file_attachments, and instead uncomment the @query parameters then i do receive an email
what am i missing with the @file_attachments parameter?
thank you
September 17, 2012 at 9:53 am
The query looks good. I don't think there is any additional arguments to be passed for attachements. The only thing I would like to point out is SQL Server limits the size of attachment to 1 MB by default.
February 19, 2013 at 11:35 am
The script above does indeed work -- the email just went to the junk folder 😀
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply