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

Mitchell Smit
Mitchell Smit
9,219 Points

HTML Contact-form

Hello Guys,

I have a question, does anyone know how to send information from a contact form directly to my e-mail? Is this even possible because right now i don't even know where to store this type of information.

Thanks,

Mitch

Kingsley Felix
Kingsley Felix
8,591 Points

yes i think, you will have to use mailto: somewhere with the opening form tag.

2 Answers

Steven Parker
Steven Parker
229,608 Points

You can't send email directly using a form, but the form can submit data to the server and then the server can send the email. Setting that up depends on the server. For example, Wordpress sites have a standard contact form you can include in your site and a configuration menu where you put your email address.

Another approach is to use a "mailto:" in the form's action, but that may not work depending on the user's mail agent and/or browser. At best it will open the user's mailer and fill in the info but the user will still have to select "send" to generate the email.

Mitchell Smit
Mitchell Smit
9,219 Points

Thanks, i think its time for a couple more treehouse courses hahahaha