473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

digicrowd
4 New Member


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.
Expand|Select|Wrap|Line Numbers
  1. <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;">
  2. <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>
  3.  
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.
Jul 31 '08 #1
3 100066
ptw02118
1 New Member
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
Aug 1 '08 #2
pbmods
5,821 Recognized Expert Expert
I maintain the web email system where I work. Here are some observations I have noticed, esp. wrt the previous comment:

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.

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.

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.

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

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.

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.
Sep 19 '08 #3
zuluflyer
1 New Member
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.
Jul 31 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2890
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's webmail. And I know they work on *my* Outlook Express. But I have one person (I know of) who gets the emails as plain text, so she sees the HTML code for the email instead of its proper representation. She has, like myself, OE6, and other html emails...
2
3202
by: Damien | last post by:
Hi to all, After hours of attempts and "googling", I'm still pulling my hair off my head when I try to send multipart html emails. It "works" on PCs with Outlook when I juste send a single "related" mail: one part for the HTML body, and several for the images. However, the images do not show on a Mac. I also wanted to have an "alternate", plain text message. I've tried the method described by Zend and PHPBuilder, but no luck...
8
2303
by: John | last post by:
Hi I am using the following code to send html emails via outlook. objOutlook = CreateObject("Outlook.Application") objOutlookMsg = objOutlook.CreateItem(Outlook.OlItemType.olMailItem) fso = CreateObject("Scripting.FileSystemObject") ts = fso.OpenTextFile(m_objParentForm.txtHtml.Text.ToString, 1) eMessage = ts.ReadAll With objOutlookMsg
12
3933
by: Dave G | last post by:
Apologies if this has been covered before - I couldn't find it. I currently use ASPEmail to create and send HTML emails from an Access database. The text is personalised and includes embedded graphics, eg logos and even the recipients photo. Note that everything is embedded, no attachments are sent. ASPEmail works a treat but is very long winded to create. The email designs come to me as finished HTML but I have to extract the source and...
21
2731
by: maya | last post by:
hi, I'm designing an HTML email for a client.. I know general guidelines (no CSS, no JavaScript... although I do use limited CSS, inside tags (as in <span style=".."we do this at work and it works fine, so I figured it's ok..) but I have a few more questions, for example, is it ok to do client-side image-maps? is there a web page somewhere with general guidelines for HTML e-mails? (and what is best way to test HTML e-mails? (I...
0
1185
by: ja | last post by:
To explain: I want to send HTML email from windows.forms app. I need to have textual templates which could be used for changing email bodies. Is it possible to use ASP.NET controls to achieve this? Something like: 1) read textual content from a file to a string (text being mixture of HTML and ASP.NET tags). For example parent ASP.NET panel control with number of other ASP.NET controls within.
3
3109
by: CJM | last post by:
David, Thanks for the reply. Responses inline: "David E. Ross" <nobody@nowhere.notwrote in message news:OZadnaBdOMGpYb3VnZ2dnUVZ_vOdnZ2d@softcom.net... This is a promotional mailshot so image is important. I understand what you
0
3211
by: kronus | last post by:
Hey everyone, I am stumped once more and you guys have always helped in one way or the other. I am just now starting to fool around with using PEAR to send html emails. Following the sample scripts -- http://www.phpmaniac.net/wiki/index.php/Pear_Mail#Sending_to_multiple_recipients -- I was able to send html emails with no problem. However, when I applied these concepts to a dynamically generated email, the recipients would receive an...
19
9457
rahulephp
by: rahulephp | last post by:
Hi there, I tried a lot to send HTML code using php mail fuction, but when email sent, it showing all html tags (including style property as well). Can you please let me know any script to send HTML formatted newsletter using PHP. (It should show only formatted text with all html property and not html tags)
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.