Forum: Ruby on Rails Creating html e-mails with embedded graphics

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Errol S. (Guest)
on 2006-01-28 02:11
I am new to RoR and I have a new project for which I'd like to use it.
I have created a short list of the important functionality I need and it
seems like everything is covered except one thing:

I need to generate and send mime-encoded e-mails with a plain text part,
an HTML part with embedded graphics, and possibly an attachment.

In the old days (up until last week) I would have used some a nifty PHP
class that I've used in the past to do this part.  Is there some
functionality built in to ActionMailer that handles this?  If not, is
there a plugin that adds this functionality?

Thanks,
Errol
Farrel L. (Guest)
on 2006-01-28 09:27
(Received via mailing list)
You can embed data in the actual url using the data: url type. Check
out http://en.wikipedia.org/wiki/Data:_URL
Errol S. (Guest)
on 2006-01-28 17:22
Farrel L. wrote:
> You can embed data in the actual url using the data: url type. Check
> out http://en.wikipedia.org/wiki/Data:_URL

Thanks very much for the reference.  However, after reading the
wikipedia entry, it does not appear that this is a workable solution for
two reasons:

1. According to the article, IE does not support this.

2. All browsers limit the size of the data.  Given that a Base64 encoded
image will be about 1/3 larger than the file size on disk, that means I
would be limited to really small images.

I had read that ActionMailer (and the classes upon which it is based)
provides a lot of powerful functionality.  Please don't flame me for
saying this, but it would seem surprising to me if some basic MIME
features like this were missing.

There are several classes for PHP that allow me to import an HTML page,
scan it for img tags, and output MIME parts to add to the e-mail.

Does this type of functionality exist already in ActionMailer?

Thanks again,
Errol
This topic is locked and can not be replied to.