Is it possible to send email attachment using dbmail from cmd? I'm using a batch file to send email attachment using dbmail but getting an error. Here is my code:
sqlcmd -q "EXEC msdb.dbo.sp_send_dbmail @profile_name = 'ProfileName',
@recipients='example@test.com',
@subject='Test Attachment ',
@body='Using dbmail to send attachment',
@file_attachments='C:\document\example.txt'"