Html attachments in outlook

How to insert HTML code to Outlook emails

Let’s say you are using Microsoft Outlook and you have to design & send a HTML email (for example, a HTML newsletter with some text & images). First of all, you will quickly learn that – if you design the email using Outlook or Word – the email source code will actually render badly on other email clients. This happens because Outlook is generating the email source code using mostly VML (Vector Markup Language) which is poorly supported by other email clients. So how do you insert HTML code to Outlook emails?

You will have to somehow import a clean HTML source code, to an Outlook email, in order to get it displayed correctly on most email client applications.

Читайте также:  Minigame forever css v34

Outlook always alters imported HTML code, unless you use an OFT template file, a macro trick or Bells & Whistles for Outlook

To insert your own HTML email code, there are many articles on the web advising you to drag and drop the HTML file over Outlook or insert the HTML file using the “insert as text” feature. Well, they are simply wrong. You will soon discover that Outlook alters / converts your HTML code: there is no way to insert your own, clean HTML code to Outlook by simply doing a copy / paste or drag’n’drop operation.

Basically, to insert clean HTML code to an Outlook email, you have three solutions:

1. save your HTML file as an Outlook OFT email template, then pre-load your email with the OFT template (see this tutorial on how to create an Outlook OFT template from HTML);

2. use a macro script to load the HTML code directly to an Outlook email;

3. use Bells & Whistles for Outlook: it adds an “Insert HTML” button to your Outlook email editor, making it extremely easy for you to select a HTML file and insert its HTML code to your Outlook email.

How to insert clean HTML code to Outlook

How to insert html to Outlook using addin

Assuming you’ve downloaded Bells & Whistles (download link), all you have to do is to open a new Outlook email, then go to the Bells menu and click on the big blue “Insert HTML” button and browse to select the HTML file that will be loaded in your email. That’s it!

If you don’t want to use the Bells & Whistles addin to insert HTML code, we will describe below a programmatic way to add your own HTML code to Outlook emails without having it altered by Outlook.

Make sure you are not using a trial-expired version of Office (Developer mode is disabled in expired Office trials). The following procedure was tested on Microsoft Outlook 2010 and 2013.

customize Outlook ribbon

1. Enable the Outlook Developer mode by right clicking on the Outlook ribbon (menus area) -> choose Customize Ribbon -> mark / enable Developer;

Outlook macro security

2. In the Developer tab, go to Macro Security -> enable “Notification for all macros”;

Word library

3. In the Developer tab, click on Visual Basic -> Tools -> References -> enable “Microsoft WORD 15.0 Object Library” (don’t confuse it with “Microsoft Office 15.0 Object Library”). If you are using Office 2010, look for Word 14.0 (15.0 means Office 2013);

new Outlook macro

4. In the Developer Macros-> Macros menu, type a name for the new macro (for example, InsertHTMLFile) then click on Create;

5. In the Macro editor, copy & paste the following source code, between the Sub End Sub lines:

Dim insp As Inspector
Set insp = ActiveInspector
If insp.IsWordMail Then
Dim wordDoc As Word.Document
Set wordDoc = insp.WordEditor
wordDoc.Application.Selection.InsertFile «e:\test.html«, , False, False, False
End If

6. Replace “e:\test.html” with the actual path to the desired HTML file that you want to insert to the Outlook email message body. Make sure you use an absolute path to the HTML file (for example “C:\MyDocs\outlook-file.html” and not “MyDocs\outlook-file.html”);

7. Save the macro. Just in case, restart Outlook to activate the changes;

insert clean HTML to Outlook

8. Create a new Outlook email, then go to the Developer tab -> Macros and select the newly created macro. It shall insert the non-altered HTML code to your Outlook email 🙂

While the above HTML insertion method is far from being a 2-clicks solution, it actually is the simplest method to insert non-altered, clean HTML code to Outlook emails. Although it surely is counter-productive to use this method on regular daily emails, it can be a helpful solution if you are sending an email newsletter through a mail merge add-in like Easy Mail Merge.

Outlook HTML limitations

Even if you insert your own HTML code to Outlook emails, Outlook will not render it properly unless you follow these simple guidelines:
1. all links and images must be linked as absolute URLs (using something like img src=”images/image1.png” will not work, you have to use an absolute URL like www.domain.com/images/image1.png);
2. do NOT load CSS styles from external CSS files – you have to use inline CSS. Here is a nice tool that can check & clean a HTML email file: http://premailer.dialect.ca/;
3. Make sure you use HTML tags & attributes that are actually supported by Outlook. Outlook is designed to support only a sub-set of HTML 4, so some HTML tags are simply ignored. These tags are not removed from your email code (they will display just fine on other email clients that support them), but Outlook skips them. Here is a list of ignored email HTML tags.

You can always use Bells & Whistles for Outlook to insert HTML files to Outlook emails with just a couple of clicks:

Источник

Insert HTML Into Outlook

Outlook is notorious for its HTML rendering. The system is relatively hostile to the coding, which is why “Send HTML email Outlook” is a common search query. Given the variety of versions, how can you do it properly? Marketers adapt their messages to Outlook. This system is used by millions. You can be sure a share of your audience reads messages on Windows. Mail recipients are annoyed by broken links and missing images. These may trigger a flow of unsubscriptions. What started as a thoughtful marketing campaign may cause your audience to shrink. Plain text will not receive much attention. This is why professionals use HTML in Outlook . Colorful messages in HTML are now the marketing standard. If you have a template ready, it is easy to insert HTML into Outlook.

HTML email Template

How to Put HTML in Email via Templates

The following sequence will help you insert HTML into Outlook 2016 and other versions. With a template, the process is quick and straightforward.

  1. Click on the “New Email” in Outlook. Or use a Ctrl+N shortcut. A new window will pop up.
  2. Right-click on the top of the window to add the “Attach file” option. Or use menu Insert and Attach File button on ribbon.
  3. With your cursor in the message window, click on the newly added button to attach your template.
  4. Browse to the location of the HTML file. To embed as text, click on the arrow next to the “Insert” button.
  5. Choose “Insert as text“.

The attachment option may also be added to your Quick Access Toolbar. To do this, access options through “File“. You will see “Quick Access Toolbar” on the list on the left. Choose “Attach File“. This allows you to embed HTML in Outlook quickly.

Important Tips for HTML in Outlook

So, how can you make sure your message is not distorted? Here are a few tips from experts. These will prevent the most common problems like broken links and formatting disasters. Create HTML email in Outlook with these factors in mind.

1. Use Alt Text for Every Image

The mail client may block images. A possible solution is the addition of alt text. This is a simple word or phrase describing the image. If it is missing, the recipient can still read the description in the box and unblock it.

alt=”Dashboard” src=”vf-logo-white.png” width=”40″ height=”40″>

2. Make Sure Fonts Are Right

One major downside is that MS Outlook recognizes a limited range of fonts. Anything unfamiliar is automatically converted to Times New Roman, which may look awful. To be safe, use standard options like Courier, Arial, Veranda, or Georgia.

But what is your font that is part of the brand image? In this case, force the system to use an acceptable standard font instead of Times New Roman. This will serve as your fallback.

3. Tables Are Handy

This format helps to structure your message template. You can easily split content, choose backgrounds, style text, etc. Use tables to ensure all recipients see the same rendition regardless of their mail system. Remember to add align=”left” to make the message responsive. This way, boxes will be displayed conveniently on both wide and small screens. In the first case, they will be aligned next to one another. In the second case, they will be placed on top of each other.

4. Not Too Wide!

A rule of thumb is to stick to 550-600 pixels. This is because wider emails may be displayed incorrectly. Keep your messages narrow, so they can be viewed on any screen. There will still be enough space for an eye-catching design.

Testing is Crucial

Knowing how to send HTML email in Outlook is important. Do not forget to test your work before sending it. Check how it looks on every platform. This stage is worth your time, as it guarantees the right look.

More Knowledge Base articles

Where is Outlook Data File PST located? Learn how to find it

Outlook is a widely used email client, which is professionally developed by Microsoft. It offers many advanced features to its users, such as emails, calendars, tasks, contacts, notes, and many…

Resolving The File is Not an Outlook Data File (.pst) Error

Outlook is a popular email client used by millions of users worldwide. It is widely used by individuals, businesses, and organizations to manage their emails, calendars, tasks, and contacts. However,…

How To Fix ‘Errors Have Been Detected in OST file’ Issue?

As a Microsoft Outlook user, you may experience the “Errors have been detected in the file xxx.ost» error message. This situation can be frustrating and confusing, especially if you rely…

How to Fix the “Unable to Open Outlook Attachment” Error?

Are you tired of getting the “unable to open Outlook attachments” error message whenever you try to access a file attached to your email? Sometimes Microsoft Outlook users face difficulties…

How to Solve “Outlook Data File Has Reached the Maximum Size” Error

Outlook is a powerful and widely used email client that helps millions manage their daily communication needs. However, as your mailbox grows, you may encounter an error message that can…

Click on a star to rate it!

Average rating 2.8 / 5. Vote count: 40

No votes so far! Be the first to rate this post.

As you found this post useful.

Follow us on social media!

We are sorry that this post was not useful for you!

Tell us how we can improve this post?

Источник

How to Insert a Text or HTML File into a Message

You can insert text or HTML files in messages in Outlook (any version.) Use this to insert «boilerplate text» or HTML created in an HTML editor.

attach file command

In Outlook 2016, you need to customize the Quick Access Toolbar or Ribbon to add the Insert File command to the ribbon — the default Attach File command on the Insert menu won’t offer the opportunity to insert a file as text. The old Attach File command, which has the Insert as Text option is available in the customize dialog.

Tip: Make sure you choose the second Attach File command, the one that does not expand.

When you click this Attach file dialog, you’ll have the older options to insert the file as text.

To Insert text or HTML files into a message:

  1. Click the Attach File icon in Outlook 2007, 2010, and 2013
  2. Select the file and expand the Insert button.
  3. Select Insert as text. If the file contains HTML tags, it will render in the message as HTML.

More Information

You can use VBA to insert HTML stationery or text files as the message body. See «Create a New Message using an HTML File or Stationery» for the code.

How to Insert a Text or HTML File into a Message was last modified: February 14th, 2019 by Diane Poremsky

Источник

Оцените статью