IntroductionIn this post I am explain how to Send Email with attachment. In many cases we need to send emails using ASP.NET and also required to send email with attachment. We can send email with attachment with the following steps:
PrerequisiteI used followings:
- .Net framework 4.0
Steps :Just follow the steps and get result easily.
Step - 1 : Create New ProjectGo to File > New > Project > Select asp.net mvc4 web application > Entry Application Name > Click OK.
Step-2: Add a Web form.Projects > Add new item > Select Web Form under Web > Enter name > Add.
Write following HTML code to the web form(page) under form tag.
Step-3: Add Folder to Save attached file.Right Click on ProjectName under Solution Explorer > Add > New Folder > enter folder name.
Here I have added a folder named EmailAttachment
Step-4: Add Code.Double click on Send Email button.
Write following code in button click event.