Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other An issue I’m having with setting up my form so that I receive mail. Re: An issue I’m having with setting up my form so that I receive mail.

#49016
ChrisBull
Member

HTML can’t send an email. The code you’re using as the forms action ‘mailto:[email protected]’ is so that the person who clicks it ‘It’s usually the ‘href’ value of an ‘a tag’ can send an email to that address.
If you want to send an email to the address the user enter I advise you to send the form to a php file, so action=”sendMail.php”, alternatively you can leave the action blank and put the form into a php file, either way works well.

In side the php file you will want to check if the form has been entered, so…


if(isset($_POST)) {
send the mail
}

The to actualy send the mail you would use the php mail() function.
Of the top of my head I think it is like this,


mail('who its to', 'the mail subject', 'the message', 'headers');

But again that’s just from memory, There are HUNDEREDS of tutorials out there, make sure you check php.net aswell.