Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:50:20+00:00 2026-06-14T06:50:20+00:00

I need to send an email to gmail with some inline images. I use

  • 0

I need to send an email to gmail with some inline images.

I use perl and MIME:LITE, but Gmail shows my image as Attachment, not inline.

What’s the problem?

This is my code,

use MIME::Lite;

my $texto = '<html><body>hola <img src="cid:image" /> adios </body></html>';

#
my $msg = MIME::Lite->new(
    Date            => "Xxx, 22 Oct 2012 17:45:00 CET",
    From            => "pruebachunga@aqui.com",
    To              => 'chimpun@forum.chimpun',
    Subject         => "En un lugar de la mancha",
    'Message-ID'    => '123456789012345656789@8888888888888ldkf',
    Type            =>'multipart/related'
);

$msg->attach(
    Type => 'text/html',
    Data => $texto,
    Encoding => 'quoted-printable'
);

$msg->attach(
    Encoding => 'base64',
    Type => 'image/png',
    Path     => "image.png",
    Id => "image"
);

$msg->scrub(['x-mailer', 'Content-Disposition']);

print $msg->as_string;

The result is this email (I strip image secction)

Content-Transfer-Encoding: binary
Content-Type: multipart/related; boundary="_----------=_135100636840600"
MIME-Version: 1.0
Date: Xxx, 22 Oct 2012 17:45:00 CET
From: pruebachunga.com
To: chimpun@forum.chimpun
Subject: En un lugar de la mancha
Message-Id: 123456789012345656789@8888888888888ldkf

This is a multi-part message in MIME format.

--_----------=_135100636840600
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html

<html><body>hola <img src=3D"cid:image" /> adios </body></html>=

--_----------=_135100636840600
Content-Id: <image>
Content-Transfer-Encoding: base64
Content-Type: image/png; name="image.png"

iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAAEwO1XwAAAAB3RJTUUH1gYE
...
kmqg1wGgkx35p/KStnLuw2BGhXwIZqT+D8sxTLVK0VpuAAAAAElFTkSuQmCC

--_----------=_135100636840600--

EDIT:

After reading on the web, I think that image is an attachment and has a problem known as "Image Blocking": https://www.campaignmonitor.com/resources/guides/image-blocking-in-email/

I maintained my question because people may find this question interesting. Now, I think that this code is correct, and with the other message, other ID, other sender… this code can run well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:50:22+00:00Added an answer on June 14, 2026 at 6:50 am

    After reading on the web, I think that image is an attachment and has a problem known as "Image Blocking": https://www.campaignmonitor.com/resources/guides/image-blocking-in-email/

    I maintained my question because people may find this question interesting. Now, I think that this code is correct, and with the other message, other ID, other sender… this code can run well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send an email with some attached images. I also need to
We use Google Apps (Gmail) to send and receive all of our email. Our
I need to send an email using Javamail and TLS (not STARTTLS, but a
How can I send email using Perl through my Gmail account? The one CPAN
I need a tiny Windows script to send a 1 line email to Gmail
I need to send out an email with multiple image attachments from PHP. I
I need to send email notifications to either a group or user on every
i have a simple contact us form and i need to send an email
For educational purposes, I need to send an email through an SMTP server, using
I need your help. I have a php script to send email to people

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.