Categories
Content Marketing Create HTML Email Marketing Web Development

How to Create HTML Email: Combining Images and Text

One of the frequent questions I get about creating HTML emails is how to combine images and text.  In this tutorial, I’m going to cover creating an HTML file similar to the one in this post, however instead of using the text image, I’m going to use actual text.

Using a combination of images and text allows you to create hyperlinks, change the text formatting however you like and using whatever HTML elements you want to in order to enhance your email communication.

What Will I Learn From This Series

In this tutorial, I will convert a PDF flyer into an HTML document with images using the slice tool.  Next, I will review and clean up the HTML code using Dreamweaver.  I’ll briefly touch on uploading images to a webserver and then using the HTML code to either send an HTML email or create a web page.

What Tools Do I Need?

  • Adobe Photoshop
  • Adobe Dreamweaver
  • Filezilla
  • A Webserver (If you don’t have one, I recommend Bluehost)

First Steps – Photoshop

In this series, I’m starting with a PDF flyer that was created by my marketing department.  A flyer is great for print marketing, but sending emails with flyers attached as PDF documents is pretty old school.  I want my marketing strategy to include similar design, but in flyer format, HTML email and on the internet in the form of a web page.  I’m after consistency in multiple mediums.

(The next logical step would be to create a video using the same imagery, but that will be the stuff of another tutorial!)

In order to do this, I’m going to use Photoshop to convert my PDF document into an HTML file and a set of images.

Photoshop will open the PDF into an image format.  Using the slice tool I will simply draw a box around the parts of the image that I want to turn into individual pieces.  This flyer can be simply cut into 3 main areas, a header graphic at the top, a sidebar graphic on the left and the body text.

Slice Tool in Photoshop

After slicing the header graphic, Photoshop will help you with the remaining slices by “snapping” the slice tool to the corners of the slice you already made.

After the three main areas are sliced, you will notice that Photoshop has also created some automatic slices from the remaining areas of the flyer, specifically the white border around the edge of the document.  We’ll clean this up in the next step.

Sliced Image

Save for Web and Devices

Using the Save for Web and Devices option, Photoshop will convert your slices into individual images, saving them in an images folder on your hard drive.  Make sure you select HTML and Images in the options area in the save for web and devices dialogue box.  Photoshop will then add an additional HTML file created from the slices.  The HTML file will reference the individual images in the images folder.

You have a number of options in this area.  Two of the important ones are the file size and the image format.  In this example, I am changing the file size to 800 pixels from the original size of the PDF (in this case 2550 pixels!).  This is because many people still have smaller monitors and I want my HTML email (and/or web page) to render nicely for anyone who views it.

Save for Web & Devices

Also, I want to optimize the actual images that are saved so they load quickly and aren’t too large.  I have a number of options including GIF, PNG (use this if you need transparency), and JPEG.  In this example, I’m using JPEG format because I don’t need any transparency and the file size is small for fast loading regardless of people’s internet connection.

Note that all slices will be saved to the images folder, not just the ones you want.  Looking in my images folder, I not only have the three main images that will make up my HTML email, but also the “extras,” the white borders around the document that were created by Photoshop out of the left over space.

Image Files

Cleaning the HTML Code in Dreamweaver

Once I’ve saved for web and devices, I’ll open the HTML file in Dreamweaver.  Remember, the HTML code is using the src tag to reference the images saved in the images file.  That’s why the path starts with <img src=”images/…”>.  This path is the most important item in creating your HTML email because this tells the recipient’s email program or web browser where to find the image on the internet.

Path in Dreamweaver

When you initially save the HTML file and the images are saved on your hard drive and you open the file in Dreamweaver, you can see the images because Dreamweaver can access them on your local machine.  If you were to copy the code into an email without having uploaded the images to a webserver or changing the path to match, the image links would appear broken to the recipient of your email.  We’ll cover this in a few minutes.

First though, we need to clean up the HTML code, appropriately size and format the table and get rid of what we don’t need, specifically the extra white border around the image.  I find it helpful to work in the split view mode in Dreamweaver so I can see both the HTML code view and the design view at the same time.

The HTML code is essentially a table with each cell containing an image.  You can delete the image from the code by removing the entire image tag <img>, or clicking the image in the design view window and deleting it, but doing that will still leave an empty cell.  Empty cells in HTML code can create blank spaces in the email.  For us to remove the white borders completely, we need to delete those cells all together.

Deleting the Entire Cell

Once we delete the cells (and the image src code in them), be sure to click the refresh button so that the design view will reflect the code changes.

Next, I want to make sure the entire table width is the same as the header graphic so that my overall design looks right by modifying the width of the table to match.

Matching the Width of the Table

Here’s the re-sized table with the extra cells removed:

Resized with Header Graphic

Adding Text With Those Images

Once we have the basic structure of the flyer cleaned up, it’s time to add our text.  Because the existing text is nothing more than an image file from the original flyer, I’m going to delete that image but keep the cell as it is.

Space for the Text

This empty cell is where I’ll add my text.  Since my flyer was already created with text, I’m going to copy the text right off the PDF file and paste it into the cell, re-formatting it the way I want it. Using the cell options in Dreamweaver, I’ll change the vertical alignment to “top” so that my text starts in the upper left corner of the cell and not in the middle of it.

Vertical Alignment

Using actual text instead of a graphic with text, I can add hyperlinks and whatever HTML elements I like.  Additionally, if I’m using this as a web page, Google and other search engines will be able to index the content on the page for key word optimization.

Adding a combination of images and text gives you much greater flexibility over your HTML email.

Control the Text!

As I go through the text, editing spaces and formatting paragraphs, you’ll see that Dreamweaver has made some automatic changes to the cell width and spacing.  By changing the table view to Expanded Tables Mode, I can drag the left edge of my cell next to the left sidebar image as far as it will go.

Expanded Tables Mode

Because I don’t want my text to be right on the border of the sidebar graphic cell, but to have a little padding, I’m going to modify the width of the graphic cell to be 4 pixels wider than the image.  This will give a little border space between the graphic and the text.  Converting the table view back to “Table Widths,” I can see exactly how the code will render.

 

Get That Path Right!

The most important part of creating an HTML email is getting the path to the graphics correct.  As I mentioned above, the path tells the viewer’s email program or web browser where the image is on the internet.  Up to this point in this example, the image files are all on my local computer.  That’s fine for me, but no one else can see them.

Get the Path Right

If I update the path in Dreamweaver with the path I know I’m going to upload the images before actually doing so, my link will appear broken.

Broken Link

So my next step is to upload the images to a webserver and then update the HTML code with the exact path for the images.

In this example, I’m using the open source FTP program Filezilla to connect to my webserver and upload my images.

Using Filezilla to Upload Images

The way to check to see if your images are actually on the web and viewable is to type the exact path to the image file in a web browser.  If you can see the image, then others can too.  If you can’t, then there’s either a problem with the path, the internet connection or the graphic itself isn’t there.

Using the Live View in Dreamweaver

Once you upload the images to a webserver and edit all of the image paths in the HTML code to reflect the location of the image files, you can use the Live View feature in Dreamweaver to see if the graphics show up.  This gives you an easy way to check your HTML code before using it in an email.

Turn the Code Into an Email

Working on the video for this part…

Getting Rid of those Annoying White Spaces in Gmail!

 

 

16 replies on “How to Create HTML Email: Combining Images and Text”

Hello there,

Thank you for this tutorial!

I have a question regarding this, do I need a web server to upload the images online? Can I just upload it to dropbox and get the link and put it in the image src code?

Looking forward to your reply, thanks!

You have to have someplace online where the URL for the picture is publically available. Generally that’s a webserver. I’m not sure about Dropbox, but it may work in the public folder of Dropbox. One way to test is to put the URL in a browser. If you can view the image, then it will should up in the email. Let me know if you have success with Dropbox. That would be helpful to know.
Thanks!
Ed

Hi Jeff,
99% of the times when people are having issues with the images showing up, it’s because there’s a typo or something incorrect in the URL link. Make sure that your images are uploaded to the web server and that you can pull them up by themselves in a browser using the URL. If the link won’t show up by itself, then it won’t show up on the HTML email.
Ed

Hi Ed,

Thank you for this wonderful tutorial.

Could you please tell me the best way to add social media buttons to an HTML email?
Is there a widget in Dreamweaver? Or do I add the buttons as images to my design and give them individual slices which I would then add links to in Dreamweaver?

Obviously, I am new to this. Thanks for your help.

Meg

Hi Meg, thanks for checking out this tutorial. In an email, the best way to do that would be to find the style button you like online then add them as images in the email. You can add a URL link to each button using Dreamweaver to be directed to your Facebook page or whatever social media platforms that you are using. You don’t necessarily need to make a separate slice for each button. The slices are primarily useful to take larger images that need to be broken into smaller, more manageable parts or if you created the bulk of your content in a program like Photoshop and need to slice up the image for use in Dreamweaver.

Hi Ed,

I’ve used your other tutorial several times with great success. The most recent time, however, I noticed my text ws a bit blurry and it must be becuase it’s a picture. Before I go through all these steps I’m wondering if you can tell me if this will help make my text crisp and clear OR if there is a trick I might use in the first “how to create HTML…” to get my text back to looking good.

Yes, this should solve your issue with the text. The fuzziness that you’re getting with the text as an image is probably due to the resolution of the the image. I’ve had this problem myself and this method is about incorporating the text into the HTML so it renders as text, not as an image.

Hi Ed.
I’m making one of these for a client of mine. This has been VERY helpful. I’ve gotten everything that you have posted here with the exception of 1 thing. I’m confused as to how I am supposed to upload my image files to a server.
My server here for my internet in Australia is Optus. I have a website that is hosted by Crazy Domains.
I’m unsure of how I go about this as the video regarding the “manage site” doesn’t go into that.
Any advice would be greatly appreciated.
Kind regards, Tim

Typically, to upload images, you need an FTP client (I use a free program called FileZilla) and you need to have an account with the hosting company. So, from what you describe, you should be able to upload your images to a folder on Crazy Domains. You’d use the FTP client, or some kind of file manager utility provided by the hosting company, to copy your images to the webserver itself (along with all the other files that make up your website). To test to see if the images have been uploaded successfully, you should be able to enter the ULR for the image itself – i.e. http://www.yoursite.com/therightpath/imagename.png – and see it in your browser. If it gives you an error, then either you didn’t have the file on the webserver or the URL is incorrect. The “manage sites” functionality in DreamWeaver is basically a built in FTP client. You don’t need to do it that way, but it is a nice feature to have integrated into DreamWeaver so you can just push all files up to the server as you develop.

Big Ed. Can’t say thanks enough. Needed elements of this in a big way. Override the override. Once again, a big thanks! Rick

Hi Ed,

Ive followed your steps on how to create a html email. Seemed to work fine until I received an email from a customer saying “my email was a mess!”…..not good! I wanted to know if I create the html emailer on a mac, will it display differently on a pc?

As when I embed the email in Mac Mail it displays fine, but when I insert it As Text in Outlook on my VMware Fusion that I have on my Mac the horrible white lines appear. I’ve followed all the steps of style:block and line:hight but they’re still there.

Any Ideas?

Thanks

Sunny

Ed,

You’re video tutorial is great, best I’ve seen in a long time. Keep up these excellent work. However I’m experiencing some difficulties.

After watching the videos and following all the steps in Photoshop CS3 and Dreamweaver CS3 the final document was checked for any broken links, etc. and was perfect. Proceeded to upload the html page and images folder to my web server through filezilla, and also tested to see if the page was working properly, worked like a charm.

However, I sent myself the email (as an attachment as you said) to verify how it worked to my hotmail, yahoo,gmail and my own email account with my host. at this point was surpised since it only appeared in my hotmail account in the other its like an attachment and the page does not even showup.

Any suggestion or ideas as to what is happening.

Thanks

try the insert the emailer file As Text. There should be a arrow pointing down you can click on to choose that option when attaching a file in outlook.

Hopefully that helps

Leave a Reply

Your email address will not be published. Required fields are marked *