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
Vic Mercier
3,276 PointsWhich technologies do I need to do a button that can send email to a person .
You could create two forms to get the email address and the other to get the messsage that I want to send.After , you will need a button .
But what code do I need to put in my listener? //Listener button.addEventListener("click", () => { //Code that I don't know }); Are there courses on Treehouse where we can learn that?
1 Answer
Steven Parker
243,656 PointsBrowsers can't send mail. So you have two choices:
- you can use a "mailto: address" link to bring up the user's mailer (maybe, depends on browser)
- you can send the form back to the server and have server code send the mail
Vic Mercier
3,276 PointsVic Mercier
3,276 PointsCheck the link to have a better understanding: https://www.henrikac.com/contact.php
Steven Parker
243,656 PointsSteven Parker
243,656 PointsThat link is an example of choice 2. The form is sent back to the server and the server code (contained in "send_mail.php") sends the mail.
Vic Mercier
3,276 PointsVic Mercier
3,276 PointsWould you be able to create the example 2.
Steven Parker
243,656 PointsSteven Parker
243,656 PointsI'm not sure what you mean, but I'm not a PHP developer.