troubleshooting Question

MapiSendMail attachments don't display

Avatar of PacificaResearch
PacificaResearch asked on
SoftwareProgrammingC++Microsoft DevelopmentEditors IDEs
13 Comments1 Solution1140 ViewsLast Modified:
I'm using MapiSendMail to send email with a .PNG graphic file as an attachment. The email is delivered and received OK, but the .PNG file arrives as an attachment, not as a graphic displayed in the email body as I would like. The Microsoft documentation states that an attached file will simply display by default unless the nPosition member of the MapiFileDesc struct is -1.

The contents of the received email have something like this:

MIME-Version: 1.0
To: donald@pacificaresearch.com
Subject: Sales Invoice #107628 from Skyline Fluid Power, Inc
Content-Type: multipart/mixed;
 boundary="------------000505030408020502090309"

This is a multi-part message in MIME format.
--------------000505030408020502090309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Your sales invoice #107628 from Skyline Fluid Power, Inc is attached.


--------------000505030408020502090309
Content-Type: image/png;
 name="email_107628.png"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="email_107628.png"

iVBORw0KGgoAAAANSUhEUgAACfYAAAzkCAIAAACYgxr+AAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAC4jAAAuIwF4pT92AAAgAElEQVR4nOzd29ajKqIG0LhGvf8ruy/SlZ0yisgZnXP0
Ra/8igjGSvwCLOu6vgAAAAAAAACYwX+9KwAAAAAAAABALBEvAAAAAAAAwDREvAAAAAAAAADT
EPECAAAAAAAATEPECwAAAAAAADANES8AAAAAAADANES8AAAAAAAAANMQ8QIAAAAAAABMQ8QL
AAAAAAAAMA0RLwAAAAAAAMA0RLwAAAAAAAAA0xDxAgAAAAAAAExDxAsAAAAAAAAwDREvAAAA


The .PNG file is there. I think this is a clue:
Content-Disposition: attachment;

If I open an email dialog and drag the .PNG file into the body, I get something like this:

Content-Type: image/png;
 name="email_107628.png"
Content-Transfer-Encoding: base64
Content-ID: <part1.02020306.07010600@pacificaresearch.com>
Content-Disposition: inline;
 filename="email_107628.png"

iVBORw0KGgoAAAANSUhEUgAACfYAAAzkCAIAAACYgxr+AAAABmJLR0QA/wD/AP+gvaeTAAAA
CXBIWXMAAC4jAAAuIwF4pT92AAAgAElEQVR4nOzd29ajKqIG0LhGvf8ruy/SlZ0yisgZnXP0

where
Content-Disposition: inline;

seems to specify that the .PNG file should be displayed, not attached. How can I get MapiSendFile to put the .PNG file inline and not attached?
ASKER CERTIFIED SOLUTION
PacificaResearch

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros