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

JavaScript

Automatically fill out email on button click?

I want to showcase some javascript skills

I have a template made for emails that I want the user who views my project to be able to email the template to themselves so they can see it in action.

What are the steps I can do to get this done?

I’m assuming:

Use html/css to create email forms

Use html/css to create a send button

Use javascript to verify email and fields

Output a message when email is successfully sent

Can I use javascript to automatically fill the body of the email with my code?

1 Answer

Steven Parker
Steven Parker
243,160 Points

You can pre-fill an email message body as well as the destination, subject etc.

Here's an article with tips on doing it from CSS-Tricks.

Thanks