<?xml version="1.0" encoding="windows-1252"?>
<node id="136872" title="Mail::Sender problem." created="2002-01-07 17:01:35" updated="2005-07-21 01:30:34">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
I want to send an HTML mail with an embedded gif from a Unix box to an NT Outlook client.&lt;BR&gt;So I took the example code from the module Mail::Sender, changed the variables to my local ones and Hey Presto it doesn't work!&lt;BR&gt;It sends the html and gif as attachments to a blank E-mail. The HTML should be the body not another attachment. Surely the example is bugged? Can anyone give a working example?
&lt;BR&gt;
Thanks in advance
&lt;BR&gt;

Heres the example copied from the documentation
&lt;code&gt;
     If you want to send a HTML with some inline images :

      use strict;
      use Mail::Sender;
      my $recipients = 'somebody@somewhere.com';
      my $sender = new Mail::Sender {smtp =&gt; 'your.mailhost.com'};
      if ($sender-&gt;OpenMultipart({from =&gt; 'itstech2@gate.net', to =&gt; $recipients,
                            subject =&gt; 'Embedded Image Test', subtype =&gt; 'related',
                            boundary =&gt; 'boundary-test-1',
                            type =&gt; 'multipart/related'}) &gt; 0) {
       $sender-&gt;SendFile(
              {description =&gt; 'html body',
              ctype =&gt; 'text/html; charset=us-ascii',
              encoding =&gt; '7bit',
              disposition =&gt; 'NONE',
              file =&gt; 'test.html'
        });
       $sender-&gt;SendFile(
        {description =&gt; 'ed\'s gif',
         ctype =&gt; 'image/gif',
         encoding =&gt; 'base64',
         disposition =&gt; "inline; filename=\"apache_pb.gif\";\r\nContent-ID: &lt;ed1&gt;",
         file =&gt; 'apache_pb.gif'
        });
       $sender-&gt;Close() or die "Close failed! $Mail::Sender::Error\n";
      } else {
       die "Cannot send mail: $Mail::Sender::Error\n";
      }
      __END__

     In the HTML you'll have this :
      ... &lt;IMG src="cid:ed1"&gt; ...
&lt;/code&gt;</field>
<field name="reputation">
4</field>
</data>
</node>
