Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

How to make a simple button send me an email

Hey everyone...

So I'm a little stuck...

I'm coding a website and I have an area where users can sign up to a newsletter... I have a button for the submit but I cant work out how i would get it so that once you click submit, I get an email that says what is displayed in the input field

I'd greatly appreciate it if anyone can help me out! Also does the website need to be on a server for the submit button to proper work? So like if i launched the website from file explorer and its like a preview in my browser will it still send an email ? or does it need to be on the web for it too work? Yeah i'm a little confused hahah

thanks matt

2 Answers

Hi Matt,

Sounds like you need a little PHP script to grab the form data and, answering you other question a little, use the server to send you an email.

Before I used WordPress or had a clue about PHP this article on How to create a Contact Form really saved my life.

Hope this helps! Craig

Craig your the best! Thanks so much, this looks very helpful!!