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

Html form to email

I need a simple form just so the user on a site can enter their name, email, and what services they are needing. I don't need to collect any data at the moment. I just want it to be sent to an email address so they can be followed up with. Is using the mailto: inside the action attribute bad or is it ok for what I want by simply sending brief info to an email?

Thank you in advance for your help...

2 Answers

Hi Tim

As a placeholder i would say its fine but as a long term thing, mailto is generally avoided especially for sensitive information as its not very secure as well as mailto being very limited in what it can do.

It is also not supported for all email clients and could produce incorrect results, or no results at all.

A long term plan would be to have proper server side validation and mailing (i recommend PHP, the mailing is fairly straight forward to set up) and client side validation with JavaScript.

Hope this helps

Liam

Thanks for the info! Yeah it will definitely be a placeholder short term just to get the layout and until I can hook up the php and validation. I appreciate it.

Tim, yes it is okay to use as a placeholder. I created a button with a href to bring up a populated email for my "biz" to receive responses. <button><a href="mailto:emailbox.com"><strong>Email:<\strong> @gmail.com</button></a>