EDIT: Basically, I was to copy text FROM a file, not copy the file (.txt) itself. Thanks again for any help!
I'm looking to copy text from a file (.txt) and send it inside the body of an email using a batch file.
Here is the syntax I am using to send the email (which works perfectly via SQL Server Mgt Studio's database mail) from a batch file.
sqlcmd.exe -E -Q "exec msdb.dbo.sp_send_dbmail @profile_name = 'myname', @recipients = '
[email protected]' , @file_attachments = 'attachment.txt', @subject = 'Email' , @body = 'Email text for the file attachment' , @body_format = 'HTML'"
I would like to take the text OUT OF the file and put it IN THE BODY of the email rather than attaching the text file.
Any help would be greatly appreciated!
Thank you