I'm using perl to try to send e-mail consisting of ".gif" and ".jpg" files in the body of the e-mail. I don't want them to be sent as attachments. I tried using Mail::Sendmail but it only send the files as attachments.
(Additional emphasis by me)
I personally believe that it is technically impossible. What you can do it to concoct up a HTML-formatted email with <img> tags which refer to attached images through a cid URI scheme.
Also, I'm not terribly familiar with the myriad of ?mail* modules, but Mail::Sendmail is a nothing but a "simple platform independent mailer" and is last updated as of 2003: this may not be a problem, as much as a hint that it is stable and good enough not to need any further development, however it also suggests you may look for something better!
I then tried MIME::Lite and that looked like I might be working in the right direction but I got stuck when it said there wasn't any sendmail attachment on the windoze system.
MIME:Lite is certainly capable of doing what you need: thus you should show us some code proving it fails to work for you. As a hint, however, take the following snippet:
Come to think of it, it may be the basis of a HTML2MHTML converter... (That's how I tested it: who said exploder is totally useless?) Caveat: this assumes but does not check, that all images are stored locally on your system so there many refinements to do, or you may want to download them if they're not local, and so on.
However, there must be modules already to do the same in an easier, dwimmier way and a simple cpan search found out one such module, namely HTML::Mail, which also seems updated quite recently.
Notice that if you send HTML-formatted mail, you should include a pure text version of the same mail: H::M lets you add a text part to it, period. But then you can do the conversion yourself, and I recommend using HTML::FormatText::WithLinks. I can also point you towards an article describing how to use MIME::Lite::TT::HTML to send HTML-formatted email created with the aid of a templating system, which you may like ot not as an idea... and the latter module does use precisely H::FT::WL to create a pure text version of the mail if one is not specified manually.
Conclusion: you have quite a lot of choices!
|