The below snippet of code is part of a script that can send email with a
dozen or more .png attachements to a list of addresses.

I need the script to send an html doc instead because I can't rely on
receiving clients to display <line of descriptive text> followed by
<image_file>.

----------------------------------------------------------------------
        $msg->attach("Type" => "TEXT", 
                     "Data" => "Number of users logged-in for
                     $firm:"
                     );
        $msg->attach("Type" => "image/png", 
                    "Data" => $response->content, 
                    "Filename" => "${firm}.png",
                    "Disposition" => "attachment
                     );
----------------------------------------------------------------------

So I experimented with MIME:Lite's HTML facility.

----------------------------------------------------------------------
  Send an HTML document... with images included!
        $msg->attach(Type => 'text/html',
                     Data => qq{ <body>
                                 <p>Here's the graph for ${firm}:</p>
                                 <br>
                                 <img src="cid:${firm}.png">
                                 <br>
                                 </body> }
                     );
        $msg->attach(Type => 'image/png',
                     Id   => '$firm.png',
                     Path => '$firm.png',
                     );
        $msg->send();
----------------------------------------------------------------------

But then I ended up with no image files being attached.
Thanks for any advice.
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to