Quick way to send HTML Emails in Apple Mail (Mail.app)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • digicrowd
    New Member
    • May 2008
    • 4

    Quick way to send HTML Emails in Apple Mail (Mail.app)


    You can make your emails fancy in Mail.app by using Rich Text formatting or even included Stationery. But, a simple way to send your own HTML creation (or any web page for that matter) is to use Safari. Follow these four easy steps.

    1. Create the HTML
    Layout your HTML code including any images or graphics you'd like to include. In this example, we will make a simple birthday email to add some spice to Dan's inbox for his birthday. We will use a clipart of balloons to give it that birthday fun. Save the html as "myemail.ht ml" for this example.
    Code:
    <center><div style="display: inline-block; width: 300px; height: 100px; border: 10px dashed #F31A00; margin: 15px; padding: 10px; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; color: #337099;  background-color: #F2F100;">
    <center><span style="font-weight: bold; font-size: 20px;">Happy Birthday Dan!</span><br /><br /><span style="font-weight: normal; font-size: 18px;">Hope It Is Grand!</span><br /><br /><span style="font-size: 14px;">Love, Aunt Sue.</span></center></div><br /><img src="balloons.png"></center>
    2. Test out the HTML
    Open "myemail.ht ml" in Safari. File -> Open File... or simply drag the saved filed to the Safari application icon or any open Safari browser window. This will allow you to preview what you are wanting to send via email.

    3. Into the new message window
    If you are happy with what you have and you don't have any images to include, then simple press "command-i" and the web page will be placed directly in a New Message window in Mail.app. If you do have images to include, do a Edit -> Select All (command-a) and then paste it into a New Message window in Mail.app. This will embed an images directly into the email.

    4. Send It Out!
    Complete who your sending it to and add a subject "Happy Birthday!" and send it off! You can easily send the email to yourself to test it out to make sure it works as you so desired.

    Hot Tip: You can do this with any internet web page. Instead of sending someone a link a certain web page, you can just send them the whole page. Give it a try. If you're in Safari, "command-i" this page and send it off to someone.
  • ptw02118
    New Member
    • Aug 2008
    • 1

    #2
    This is good in theory but in practice has a number of limitations related to html emails. In most email readers:

    CSS in head <style>...</style> is ignored.
    Layers <div>...</div> do not display correctly.
    In-line CSS not tied to a handful of tags (in table tags for example) do not work correctly or consistently.
    Javascript is not functional.
    Form elements are stripped out or modified to display horribly.

    With all that in mind, html created for emails must be far simpler than the techniques used in modern Web pages. If you care about the formatting, send it to yourself before sending it to someone else, and don't send it to your email account used for Apple Mail. Apple Mail has one of the best html rendering engines out there, but since most folks do not use it, you can't rely on how it looks in Mail as any indication of how it will look in Outlook, Yahoo, Google, etc.

    $.02

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      I maintain the web email system where I work. Here are some observations I have noticed, esp. wrt the previous comment:

      Originally posted by ptw02118
      CSS in head <style>...</style> is ignored.
      This is true, especially in GMail. I know it violates XHTML standards, but you'll need to put your CSS styles in the <body>, and if you can make your CSS inline, that is generally more reliable.

      Originally posted by ptw02118
      Layers <div>...</div> do not display correctly.
      I'm not so sure about that. There are quirks, especially in Outlook '07 (uses the MS Word rendering engine (http://www.campaignmonitor.com/blog/..._design_b.html):
      • Background colors are not applied correctly.
      • Percentage widths are calculated relative to the document, not the parent element.
      • Float doesn't work. At all.


      But on the whole, a div displays exactly as you would expect a block-level element to display: with a line break immediately before and after it and 100% width.

      Originally posted by ptw02118
      In-line CSS not tied to a handful of tags (in table tags for example) do not work correctly or consistently.
      This is mainly a problem with Outlook '07 (note: not Outlook '03). Apple's Mail.app, for example, uses Webkit, so everything works the same as it would in Safari.

      Originally posted by ptw02118
      Javascript is not functional.
      This is true of all email clients, presumably as a security precaution.

      Originally posted by ptw02118
      Form elements are stripped out or modified to display horribly.
      This is also true of most email clients. It's generally not a good practice to put a form in an email anyway; it's an email message, not a webpage.

      Originally posted by ptw02118
      With all that in mind, html created for emails must be far simpler than the techniques used in modern Web pages. If you care about the formatting, send it to yourself before sending it to someone else, and don't send it to your email account used for Apple Mail. Apple Mail has one of the best html rendering engines out there, but since most folks do not use it, you can't rely on how it looks in Mail as any indication of how it will look in Outlook, Yahoo, Google, etc.
      This is good advice. You especially want to make sure you test the following clients:
      • Microsoft Outlook 2003
      • Microsoft Outlook 2007 (uses a completely different rendering engine than '03)
      • Apple Mail.app
      • AOL (desktop and web apps)
      • Microsoft Outlook Web Access
      • GMail (quirky about images; use good alt attributes!)
      • Yahoo! Mail


      For the web-based email clients, be sure to preview your email using different browsers as well.

      I've tested emails in about 20 other clients (Eudora, SquirrelMail, others), and they generally render similarly to Outlook '03.

      Comment

      • zuluflyer
        New Member
        • Jul 2010
        • 1

        #4
        What app would one use to layout the html and save it as a .html file? I know, I know, I win the prize of the dumbest question ever.

        Comment

        Working...