Hi I have a form set up on my page. How can I make it email my given email address?
<form action="#">
<p>Please contact us</p>
<input type="text" maxlength="30" value="Name" class="textcontact" />
<input type="text" maxlength="30" value="E-mail Address" class="textcontact" />
<input type="text" maxlength="30" value="Subject" class="textcontact" />
<textarea name="message" id="message" cols="30" rows="10"></textarea>
<input type="submit" value="" class="submit" />
</form>
I know it is something to do with form action. But there are no controllers or anything in webmatrix 2(?). How do I make it work?
Here is a guide for doing exactly what you ask, from Webforms 2.
http://www.asp.net/web-pages/tutorials/email-and-search/11-adding-email-to-your-web-site
Create a new website.
Add a new page named EmailRequest.cshtml and add the following markup:
Notice that the action attribute of the form element has been set to ProcessRequest.cshtml. This means that the form will be submitted to that page instead of back to the current page.
Add a new page named ProcessRequest.cshtml to the website and add the following code and markup: