EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'MSSQLSERVER',
@recipients = 'Teste@teste.com.br',
@subject = 'Relatório',
@body = 'Olá! <strong>Teste</strong>',
@execute_query_database = 'BaseTeste',
@body_format = 'html',
@from_address = 'Teste@teste.com.br',
@query = 'SET NOCOUNT ON;
SELECT TOP 10 * FROM Tabela_Teste
',
@query_attachment_filename = 'anexo.csv',
@attach_query_result_as_file = 1,
@query_result_header = 1,
@query_result_width = 256,
@query_result_separator = ' ',
@query_result_no_padding = 1