Pavel Shchegolevatykh Pavel Shchegolevatykh - 4 months ago 25x
HTML Question

Mailto on submit button

Is it possible to implement

function on submit button like
<input type="submit" />
? I use ASP.NET MVC. Maybe there is some tricky controller action result to achieve this. Could you please help me?

P.S. I know that I can make anchor looks like a button.


In HTML you can specify a mailto: address in the <form> element's [action] attribute.

<form action="mailto:youraddr@domain.tld" method="GET">
    <input name="subject" type="text" />
    <textarea name="body"></textarea>
    <input type="submit" value="Send" />

What this will do is allow the user's email client to create an email prepopulated with the fields in the <form>.

What this will not do is send an email.