No such thing as a small change | |
PerlMonks |
Re^2: Send Email With Picture Embedded in Body of Emailby afoken (Chancellor) |
on Sep 10, 2020 at 15:01 UTC ( [id://11121554]=note: print w/replies, xml ) | Need Help?? |
In the mail header, you claim to encode the entire mail as base64, but you send it in plain text. That won't work. A little bit later, you use a base64 encoded file as URL of that file in an IMG tag. Of course, that also won't work. For an image URL containing the image instead of pointing to it, use a data URI. You would at least need to prefix the bas64 encoded image with "data:image/jpeg;base64,". Note that several HTML viewers have size limits on data URIs, others don't accept them at all. The RFC way of sending HTML mails with images is to append the image to the mail, give it a CID, and use the CID to as the URI of the image in the HTML part. See RFC2111. MIME::Lite (yes, I know this will trigger tons of "do not use that module" warnings) has a quite easy way to do that:
(Copied from "Send an HTML document... with images included!" in the MIME::Lite pod) Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|