how to add attachment(text file) to database mail?
I was looking of for the same issue myself, and gave up. It seems that attachments can only be sent using TSQL, such as this

EXEC sp_send_dbmail 
  @profile_name='MailProfile',
  @recipients='me@gmail.com',
  @subject='TestEmail',
  @body='I'm sending you this document...',
  @file_attachments='D:\TEST\file.doc'