In this article I’ll show you how to send a file attachment in email in ASP.NET using C#.
We took one field and one fileupload control and one button. On button click the mail body and the attached file are sent to the respective email.Initial ChamberStep 1Open your Visual Studio 2010 and create an empty website, provide a suitable name [Email_demo]. Step 2In Solution Explorer you get your empty website, add a web form as in the following.For Web Form:Email_demo (your empty website) then right-click then select Add New Item -> Web Form. Name it Email_demo.aspx. Design ChamberNext we will create some design for our application where we drag some control from the toolbox. So open your Email.aspx page and write code like the following.
ASP.NET MVC 5: A Beginner’s Guide