0

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'"
Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
Liton Uddin
  • 85
  • 1
  • 11

0 Answers0