We are in the process of adapting our Winform application into a MVC Web Application and we have Telerik Reports that we use to generate Invoices and Statements which we attach to emails.
Ideally we would call a stored procedure while passing an Id, from there we would call the sp_send_dbmail stored procedure and pass it the file attachments and other data gathered using the Id which would make our sp call look like this:
EXEC msdb..sp_send_DBMail
@profile_name ='Profile'
,@subject = @Subject
,@body = @Body
,@recipients= @Recipients
,@body_format = 'HTML'
,@reply_to = @ReplyTo
,@file_attachments = 'C:\Report\Invoice 123'