PDA

View Full Version : Embedding an image in an email with HTML




pcproff
Jan 27, 2006, 02:35 AM
Guys,
I am designing an invitation for a client that will go out to the readers of his book for a signing. How do I embedd an image into an email? I dont want to just attach an image into the body of the email. I know there is a way to do it via HTML (if the viewer has HTML read options on the email) Can anyone help?



angelneo
Jan 27, 2006, 03:35 AM
I'm not sure how to do it in Mac (I just switched not too long ago). You can actually do it in outlook express. Click on edit source, paste in your html codes with the image linking back to your local drive image location, and when you send outlook express will automatically attach and embedded the image inline for you. I'm not on my mac now, so I can only find it out if it works in Apple Mail when I get home.

pcproff
Jan 27, 2006, 07:10 AM
Hey Neo thanks for the help I am sure I can do it in Outlook but it would be nice to find out how to do it in Mail. Thanks for all your help.

angelneo
Jan 27, 2006, 10:04 AM
I wouldn't be able to access my powerbook in a while so I did some poking around the net. I found some apps on version tracker that may help you do it.

http://www.versiontracker.com/dyn/moreinfo/macosx/21993
http://www.versiontracker.com/dyn/moreinfo/macosx/11026

ahunter3
Jan 27, 2006, 11:36 AM
Guys,
I am designing an invitation for a client that will go out to the readers of his book for a signing. How do I embedd an image into an email? I dont want to just attach an image into the body of the email. I know there is a way to do it via HTML (if the viewer has HTML read options on the email) Can anyone help?

Unless the readers of his book are an unusual lot and/or are actively expecting such an email, putting a $##@$% image and HTML formatting into the email for your client is going to dramatically reduce the number of people who will ever see it.

Lots of folks set their spam filters to toss anything with HTML formatting straight into the trash.

Many others who don't do that do nevertheless have their email client set to NOT render HTML (because it is used by spammers to verify valid email addresses) and so they may see the email despite the HTML and the embedded image but what they will actually be seeing is your raw ugly bracket-laden code.

Email is a text-only medium and should stay that way.

:mad:

[/geezer mode]

pcproff
Jan 28, 2006, 05:01 PM
umm.. ok lol. So if your so against that, what would you do to contact 485 people via email?? Explain that one.

jsw
Jan 28, 2006, 05:13 PM
Unless the readers of his book are an unusual lot and/or are actively expecting such an email, putting a $##@$% image and HTML formatting into the email for your client is going to dramatically reduce the number of people who will ever see it.
Actually, the vast majority of email users simply use their email programs with their default setups - which, with Mail and most apps, means they'll display images that are linked in via HTML.
Lots of folks set their spam filters to toss anything with HTML formatting straight into the trash.
Lots? Yes, agreed. Most? No.
Many others who don't do that do nevertheless have their email client set to NOT render HTML (because it is used by spammers to verify valid email addresses) and so they may see the email despite the HTML and the embedded image but what they will actually be seeing is your raw ugly bracket-laden code.
Again, most users don't go to the effort to do this, although they should. However, the lack of a bounced email often serves to indicate the validity of an email address, so the image loading is usually a secondary, although more reliable, way of verifying an address.
Email is a text-only medium and should stay that way.
[/geezer mode]
I only partially agree - email, like postal mail, is at its ugliest when it's text-only, and the only valid reason I see for keeping it that way is to make it harder for spammers to verify an email address, which seems a bit ridiculous.

umm.. ok lol. So if your so against that, what would you do to contact 485 people via email?? Explain that one.
You could always provide a URL in the email which users could click on to go to a site which contained the content you would have emailed to them otherwise.

Mitthrawnuruodo
Jan 28, 2006, 05:21 PM
umm.. ok lol. So if your so against that, what would you do to contact 485 people via email?? Explain that one.Why do you need to have a html mail just because you want to mail 485 people...??? :confused:

Just make a group in Address Book, compose a nice plain text message and BCC the group...

7 reasons why HTML email is a bad thing. (http://www.georgedillon.com/web/html_email_is_evil.shtml)

Why you shouldn't use HTML email (http://www.favreau.info/display.php?page=html_email)

decksnap
Jan 28, 2006, 06:21 PM
Typically when you send out HTML emails, you are supposed to provide a plain text version also. So whatever the end user has their prefs set to, they get a legitimate looking email either way. I would do some more research on the subject. I'm not an expert, but I've learned a bit about it along the way. Another thing is typically all the images are served from a site somewhere, so you would use all absolute links in your email HTML and point them to the server where the images are stored.

Try looking at the source code for a few emails in Mail. That might help get you started. (View > Message > Raw Source)

You can also employ a service for this sort of thing if you are going to be doing it on a repetitive basis. Something like:

http://www.constantcontact.com

You can upload and manage your databases, use templates, or make your own.

pcproff
Jan 28, 2006, 08:41 PM
Why do you need to have a html mail just because you want to mail 485 people...???

Just make a group in Address Book, compose a nice plain text message and BCC the group...

My boss had me design an invitation promoting the book and he wants me to email this to people on the waiting list for the book. Well I know that HTML email is not the way to go and I never have my mail client with HTML view enabled. I will include text obviously when sending this to his clients in case they have the HTML disabled. I mean its not like we are spamming people these are clients of his that want to be emailed. I am thinking doing something like <img="http://www.url.com/pic.jpg> Is this right? If so where do I insert it?

cahill
Dec 3, 2008, 06:04 AM
I have designed my email in html and embedded my images within it like this:
<img src="http://domain/image.jpg" />. although my images are stored on my server, every time I send the email to test it, it attaches all the images. I would prefer this not happen and haven't found any solution.

anybody able to shed some light on this?

thanks in advance.

angelwatt
Dec 3, 2008, 06:30 AM
I have designed my email in html and embedded my images within it like this:
<img src="http://domain/image.jpg" />. although my images are stored on my server, every time I send the email to test it, it attaches all the images. I would prefer this not happen and haven't found any solution.

anybody able to shed some light on this?

thanks in advance.

What software are you using to create the HTML and also send the email?

SrWebDeveloper
Dec 3, 2008, 07:10 AM
Typically when you send out HTML emails, you are supposed to provide a plain text version also. So whatever the end user has their prefs set to, they get a legitimate looking email either way. I would do some more research on the subject. I'm not an expert...

That was sound, expert advice, actually. That is the proper way to handle the situation as developers. In a single E-Mail both HTML and text versions may be specified using special headers and a boundary command for each. Then upon delivery the client mail reader will present whichever format the user has selected as their default view. This is the process. Below I've included an example of how it's done in actual code.

Developers first need to learn the various mail headers/boundary commands, then simply write a script that generates e-mail combining both formats, like this:

Date: Mon, 11 Feb 2002 16:08:19 -0500
To: The Receiver <recipient@some.net>
From: The Sender <sender@some.net>
Subject: A simple mixed message
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="==Multipart_Boundary_xc75j85x"

This is a multi-part message in MIME format.

--==Multipart_Boundary_xc75j85x
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This is the text portion of the mixed message.

--==Multipart_Boundary_xc75j85x
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<html>
<body>
<p>This is the <b>HTML portion</b> of the mixed message.</p>
</body>
</html>

--==Multipart_Boundary_xc75j85x--


See the differences in the Content-Type header, text/plain vs. text/html? And the mulitpart boundry used to separate the two formats? That's what it takes "under the hood" for all software to make the magic happen. As you can see some of the headers seem to be software generated with random data (re: boundary) plus the double equal signs and double dashes that have to be perfectly setup. This is intended to comply with strict email RFC standards.

There are many PHP classes out there that simplify the mail sending process so you can do things like this concentrating on the email content and not the RFC's. Here is one called PHPMAILER (http://phpmailer.codeworxtech.com/), for example, use the one at the top. On that page are also other versions that not only send both formats, but allow powerful list serve functions for e-mail subscriptions and database recipient lists as well. It's an amazing set of classes. 5 out of 5 stars.

-jim

memco
Dec 3, 2008, 11:18 AM
Just in case you want to do more than send images, I'll point you to an article on formatting html emails (http://www.sitepoint.com/article/code-html-email-newsletters/). That should help to ensure your design renders properly.

By the by, does anyone know if Mail uses webkit to render email?

angelwatt
Dec 3, 2008, 11:40 AM
By the by, does anyone know if Mail uses webkit to render email?
According to Wikipedia, yes. (http://en.wikipedia.org/wiki/WebKit)
WebKit is used as the rendering engine within Safari on Mac OS X, Windows and the iPhone. Other applications on Mac OS X can make use of WebKit, for example Apple's email client Mail and the 2008 version of Microsoft's Entourage personal information manager both make use of WebKit to render e-mail messages with HTML content.

Just and FYI for folks popping in, this thread was originally started in 2006 and was awoken once more at post 11, so you may want to aim responses to that individual's question. Not that the other other info provided since isn't valuable.

SrWebDeveloper
Dec 3, 2008, 02:41 PM
What software are you using to create the HTML and also send the email?

I also would like to see the OUTBOUND email with full headers intact prior to being relayed. Meaning, redirect the output to a file or screen. Not the inbound one with all the images you get upon delivery (since it is processed by your mail server). If possible, please.

-jim