From: William Park Date: 2004-07-18T23:37:10+09:00 Subject: Re: Request: Lib to create HTML E-mail? James Britt wrote: > I'm looking for code to create HTML E-mail. I'd rather not re-invent > anything if possible, though my search for such a beast has turned up > nothing that does quite what I want. About the closest is SimpleMail, > but it does not handle inline images, which is critical. > > (I've also started looking at RubyMail, though I haven't seen any > indication that it supports inline image references.) > > What I would *really* like is something that takes as input an HTML > string and a hash of header values (to, from, subject, etc.), and > creates the multipart/alternative E-mail by magic. > > Ideally, it would create a plain text version, followed by the HTML > version. If the HTML contains any relative URLs, they would be > interpreted as local file paths; the file would be slurped in, > uuencoded, and added to the E-mail as a multipart/related segment, and > the img href value then converted to a cid: reference. > > I've done some hacking about on my own, munging up a copy of SimpleMail, > but before I go too far I thought I'd just check to see if someone beat > me to it. > > Any tips or pointers appreciated; please, no lectures on the evils of > HTML E-mail; this is for a specific project for people who actually > *request* such E-mail. For dis/assembling MIME email, look over http://freshmeat.net/projects/mboxsh/ by yours truly. You can create text version using Lynx. But, if you only have HTML file, then including local file and images are messy to do, because you have to parse HTML to figure out what path to include. It would be a bit easier if you already know what file or image to include in MIME email. -- William Park, Open Geometry Consulting, Toronto, Ontario, Canada