I currently have a form that on a coming soon page on my web server that I need to capture entered email addresses and send it to my email address e.g. example@hotmail.com.
What would be the best way of accomplishing this using PHP?
<form method="post">
<input class="emailsubscribe mobile clearfix" type="text" name="mail"
placeholder="Enter your email" onFocus="if(!this._haschanged)
{this.value=''};this._haschanged=true;"/>
<input class="emailsubscribe desktop clearfix" type="text" name="mail"
placeholder="Enter your email to stay up to date" onFocus="if(!this._haschanged)
{this.value=''};this._haschanged=true;"/>
<input class="emailsubmit clearfix" type="submit" name="submit"/>
</form>
Thanks in advance!
HTML:
PHP (send.php):
You should add some kind of protection like captcha to prevent spamming.