I built an HTML form and whenever I submit it I’m asked to open up G Mail or Outlook. When I do, a new email is opened with the correct email address. The problem is I want it to send without opening anything. I would like to only use HTML for the form, no PHP/MySQL.
<form method="post" action="mailto:contact@walkerloden.com" enctype="text/plain">
<p>Name: <input type="text" name="Name" size="20"></p>
<p>Email: <input type="text" name="Email" size="20"></p>
<p><input type="submit" value="Submit" name="Submit"></p>
</form>
You shouldn’t have your form action set to mailto anything.
You should instead have that direct to a script you’ve written where you can accept the POST variables and then send an email. There is a native PHP function called
mail()which will do just that. Your code should look like this:HTML
PHP – mailtome.php