How to send HTML-formatted email?

I could be able to let the web application sends automatic emails using Windows Task Scheduler. Now I want to send HTML-Formatted email using the following method that I wrote for sending emails. My code-behind: protected void Page_Load(object sender, EventArgs e) { SmtpClient sc = new SmtpClient("mail address"); MailMessage msg = null; try { msg … Read more

Adding your own HtmlHelper in ASP.NET MVC 3

I am new to MVC and I am trying to create my own extension method so that I can add onto the html helpers that are available in my razor views. Html.DropDownListFor() lets you create a drop down list for any propery on your model. I would like to create a helper called Html.StateDropDownListFor() that does the exact same thing, except loads the drop down with all 50 US states. This way I don’t have to create a SelectList for every single state drop down that I create. What is the easiest way to do this? Right now I have this: