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 Email

How do I transfer/render the HTML code I've written to represent an email into something that I can actually send as an email? Something I can put into gmail and send

  1. As you can't store images with the code as you can for a website you have to ref them from elsewhere but there are no examples of the best way to do this or recommendations on how to store images in this way

  2. At the end, ok we have the code and can preview it but how do you send it as an email? there is nothing on this which seems quite important. If I paste the code into gmail it just sends it a code

  3. I got a congratulatory email from Dan Gorgone via treehouse offering assistance and answers to any questions. I emailed him but emailed returned as that account does not exist any more

Thanks Andrew

I've looked at 4 websites that claim to be able to do that. One used google docs rather than gmail, and the menu it used doesn't seem to still exist. Then there are plugins and a hack method (in this one, you use the browser tools to modify the underlying html of the message composition window). The other suggestion was http://ctrlq.org/html-mail/, which i know nothing about. The short of it is gmail lets you copy html into the email body, but doesn't seem to be built for accepting a prebuilt html email. The techniques seem to all be ways of avoiding or subverting the standard UI. I also tried outlook and was told it wasn't possible. You might require marketing software to get this to work right. They just don't seem to want end users to have clean access to the underlying HTML. Mailchimp may have a free tier.

2 Answers

Chris Ramacciotti
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Chris Ramacciotti
Treehouse Guest Teacher

Hi Andrew! Tools like MailChimp definitely ease the process for sending rich HTML emails. If you're looking to cook your own solution, you'd want to use your programming language of choice to send HTML emails via an SMTP server. And if you don't have your own mail server, you can use Gmail as the SMTP server. Here's how you might do that:

https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server

As for the actual markup and styling, we have a course for that! In fact, this course is taught by a User Experience Designer and HTML Email developer at MailChimp. You can check it out here:

https://teamtreehouse.com/library/html-email-design

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Andrew Dickens, this article might help: http://www.programmerinterview.com/index.php/general-miscellaneous/how-to-send-an-html-email-from-gmail/

Basically,

  1. open the HTML-formatted file in a browser (just like you'd open a web page).
  2. Within the browser, choose Edit -> Select All, then Edit -> Copy
  3. Go to GMail, create new e-mail and choose Edit -> Paste

This will paste your HTML formatted e-mail in place.