Free Email Capture Form

Simple Email Capture Form in PHP

There are so many ways to handle forms in PHP, but in my experience, the simplest way for inexperienced PHP coders to understand it, is to simply send an email. If your website does not have a lot of traffic, you may want the form data sent to your regular email address. If you are pretty popular, you may want to set up a special account to handle the form data, and you can do a lot of things with this special account, but that is the subject for another type of post and/or website!

You can see a demo of my email capture form here. Yes, it is ugly. I needed to keep the form simple, so it would be easier to understand the basics. But you can take it from there. You can add CSS or html tags to change the headings, style, text color, fonts, etc. There is beauty in simplicity my friends.

How To Make Your Own Email Capture Form

I tried to make this as simple as possible for all of us. You can add comments to this post if you have questions or suggestions.

  • Download the text file here – Email Capture Form Download.
  • CHANGE the suffix from .txt to .php! So your new file should be called emailcapture.php!
  • EDIT 2 Variables at the top – $toemail and $pagetitle (To Email and Page Title). These will set the email you want the form data sent to, AND the title and heading of your own page.
  • At the bottom of the script, you will see some text that is outputted with the PHP echo function. That is what appears on the RIGHT side of the page. You shold change this to match your own website.
  • Upload the script to your own server that has PHP enabled (almost all of them do). Test it out, and start grabbing emails, comments, etc.
  • Important – I do ask you to leave the link back to this website at the bottom of the form in exchange for giving you this free code. Also, please leave the copyright info in the actual script. It is only polite, and it allows me to hand out free code. If you just cannot do this, please contact me (with our comment form) or go pay somebody else to code you a form. If I customize your form, I will either charge you or ask for barter (in the form of backlinks).
  • You are certainly free to change this code to suit your own needs. You can store the emails in a file or database, add custom fields, etc. But again, please leave the link and copyright intact unless you have permission to remove it.

Questions About the Simple PHP Email Capture Form?

Please register and leave your comments and questions. I will try to attend to them as quickly as possible.

Tags: , , ,

2 Responses

Leave a Reply