I would like a simple C# code, well structured, that will have two distinct functionalities (which can be used toguether or separately):
1- CONVERT CLASS MODELS INTO EXCEL SPREADSHEET DATA
Convert a list of class models such ash the attached \"[url removed, login to view]\" file into excel spreadsheet data; the model fields marked with the \"[ExportToExcel()]\" attribute will be excel columns and the ones not marked should be ignored. If the list (provided dummy data) has 3 items, then the spreadsheet data should present 3 rows. *NOTE: this should work with any models that have fields with the \"ExportToExcel\" attribute.*
2- SEND EMAIL WITH ATTACHMENT
The code should be able to send email to and from gmail accounts, allowing the personalization of recipients, subject, body and attachments that will be sent.
I would also like an example showing the usage of the two functionalities being used toguether: converting a list of models into a excel spreadsheet and then sending it as an attachment to a email.