Sarat1729 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I am unable to understand what is CID:<Some file name here> and how can we use it. Can someone please help me out. Thanks

Replies are listed 'Best First'.
Re: Usage of cid
by zentara (Cardinal) on Jun 05, 2018 at 09:35 UTC
    Hi, here is basically how you do it.
    #!/usr/bin/perl use warnings; use strict; use MIME::Lite; # Standard CPAN module my $from_address = 'selector@selectorweb.com'; my $to_address = 'selector@selectorweb.com'; my $subject = 'MIME test - HTML with image'; my $mime_type = 'multipart/related'; # Create the message headers my $mime_msg = MIME::Lite->new( From => $from_address, To => $to_address, Subject => $subject, Type => $mime_type ) or die "Error creating MIME body: $!\n"; # Attach the HTML content my $message_body = '<html><body><H3>Hello world! <img src="cid:myid.gif"></H3></body></html>'; $mime_msg->attach(Type => 'text/html', Data => $message_body); # Attach the image $mime_msg->attach( Type => 'image/gif', Id => 'myid.gif', Encoding => 'base64', Path => 'pikachu.gif'); $mime_msg->send;

    I'm not really a human, but I play one on earth. ..... an animated JAPH
Re: Usage of cid
by thanos1983 (Parson) on Jun 05, 2018 at 09:33 UTC
Re: Usage of cid
by choroba (Cardinal) on Jun 05, 2018 at 09:03 UTC
    Without context, it's hard to tell. What CID do you mean?

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      It's Content-Id which I believe used while sending an image as an attachment to a mail.

        When attaching an image to a MIME multipart mail (either multipart/related or multipart/mixed), you can give the image a Content-Id header with an arbitrary cid value.

        In the HTML body of your mail, you can then reference those cids again to display images.