|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 5:58 AM
Points: 34,
Visits: 418
|
|
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
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, April 22, 2013 1:44 PM
Points: 12,
Visits: 137
|
|
| 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.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Today @ 5:58 AM
Points: 34,
Visits: 418
|
|
The script above does indeed work -- the email just went to the junk folder
|
|
|
|