I'm embedding images into HTML emails using Redemption and following the example given here:
http://www.dimastr.com/redemption/
The emails appear to get created and sent fine, but the images get stripped when received by Outlook Express and get treated as attachments when received by a Yahoo account. It appears to be part of the client's virus protection. Does anyone have any idea what I can do to prevent this? Thanks.
|
|
Did you look at the message source in OE (RMB | Properties | Details | Message Source)? Arew attachments there? Are they referenced Ok by the HTML body? Do attachment content-ids look Ok?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1146087033.333632.207520[ at ]t31g2000cwb.googlegroups.com...
[Quoted Text] > I'm embedding images into HTML emails using Redemption and following > the example given here: > > http://www.dimastr.com/redemption/> > The emails appear to get created and sent fine, but the images get > stripped when received by Outlook Express and get treated as > attachments when received by a Yahoo account. It appears to be part of > the client's virus protection. Does anyone have any idea what I can do > to prevent this? Thanks. >
|
|
The attachments aren't there in OE. Also, the img tags have been removed from the source.
|
|
So the message gets modified by the mail server, right? Can you send messages with the embedded images through the Outlook UI to teh same address?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1146165283.039838.30160[ at ]u72g2000cwu.googlegroups.com...
[Quoted Text] > The attachments aren't there in OE. Also, the img tags have been > removed from the source. >
|
|
|
|
So what is different between messages created by your code and by Outlook?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1146171317.085094.157110[ at ]j33g2000cwa.googlegroups.com...
[Quoted Text] > Yes and Yes. >
|
|
Here is the message I'm sending that doesn't work:
<HTML><head><meta content="TX_HTML32 12.0.230.500" name="GENERATOR"><title></title><style type="text/css">BODY {font-family: 'Arial';font-size: 12pt;font-weight: normal;font-style: normal;} P.NORMAL {margin-top: 5pt;margin-bottom: 5pt;font-family: 'Times New Roman';font-size: 12pt;font-weight: normal;font-style: normal;} P {margin-top: 0.05pt;margin-bottom: 0.05pt;font-family: 'Arial';font-size: 12pt;font-style: normal;} </style></head><body bgcolor="#FFFFFF" text="#000000"><p><span style="font-size:10pt;">High<img border="0" src="cid:Image1" width="307" height="230" alt="[image]"></span><span style="font-size:10pt;">Joe</span><span style="font-size:10pt;">,</span></p><p><span style="font-size:10pt;"></span></p><p><span style="font-size:10pt;"> </span></p><p><span style="font-size:10pt;"></span></p><p><span style="font-size:10pt;"> </span></p><p><span style="font-family:'Microsoft Sans Serif';font-size:8.2pt;"> </span></p><p><span style="font-size:10pt;"> </span></p><p><span style="font-size:10pt;"></span></p><p><span style="font-size:10pt;"> </span></p></body></HTML>
Here is the equivalent message generated by a different source that does work:
<HTML><HEAD><TITLE></TITLE> <META http-equiv=Content-Type content="text/html; charset=unicode"> <META content="MSHTML 6.00.2900.2180" name=GENERATOR> <STYLE type=text/css> BODY {font-family: 'Arial';font-size: 12pt;font-weight: normal;font-style: normal;} P.NORMAL {margin-top: 5pt;margin-bottom: 5pt;font-family: 'Times New Roman';font-size: 12pt;font-weight: normal;font-style: normal;} P {margin-top: 0.05pt;margin-bottom: 0.05pt;font-family: 'Arial';font-size: 12pt;font-style: normal;} </STYLE> </HEAD> <BODY text=#000000 bgColor=#ffffff> <P><SPAN style="FONT-SIZE: 10pt">High <IMG height=230 alt=[image] src="cid:f457094b-602d-42b8-917e-3ee75bff0dd1" width=307 border=0></SPAN><SPAN style="FONT-SIZE: 10pt">Joe</SPAN><SPAN style="FONT-SIZE: 10pt">,</SPAN></P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> <P><SPAN style="FONT-SIZE: 8.2pt; FONT-FAMILY: 'Microsoft Sans Serif'"></SPAN> </P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P></BODY></HTML>
There are differences, but none that I can see that would cause the problem.
|
|
Can you try to set *exactly* the same HTML?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1146257439.548300.282360[ at ]u72g2000cwu.googlegroups.com...
[Quoted Text] > Here is the message I'm sending that doesn't work: > > <HTML><head><meta content="TX_HTML32 12.0.230.500" > name="GENERATOR"><title></title><style type="text/css">BODY > {font-family: > 'Arial';font-size: 12pt;font-weight: normal;font-style: normal;} > P.NORMAL {margin-top: 5pt;margin-bottom: 5pt;font-family: 'Times New > Roman';font-size: 12pt;font-weight: normal;font-style: normal;} > P {margin-top: 0.05pt;margin-bottom: 0.05pt;font-family: > 'Arial';font-size: > 12pt;font-style: normal;} > </style></head><body bgcolor="#FFFFFF" text="#000000"><p><span > style="font-size:10pt;">High<img border="0" src="cid:Image1" > width="307" height="230" > alt="[image]"></span><span style="font-size:10pt;">Joe</span><span > style="font-size:10pt;">,</span></p><p><span > style="font-size:10pt;"></span></p><p><span > style="font-size:10pt;"> </span></p><p><span > style="font-size:10pt;"></span></p><p><span > style="font-size:10pt;"> </span></p><p><span > style="font-family:'Microsoft Sans > Serif';font-size:8.2pt;"> </span></p><p><span > style="font-size:10pt;"> </span></p><p><span > style="font-size:10pt;"></span></p><p><span > style="font-size:10pt;"> </span></p></body></HTML> > > Here is the equivalent message generated by a different source that > does work: > > <HTML><HEAD><TITLE></TITLE> > <META http-equiv=Content-Type content="text/html; charset=unicode"> > <META content="MSHTML 6.00.2900.2180" name=GENERATOR> > <STYLE type=text/css> BODY {font-family: 'Arial';font-size: > 12pt;font-weight: > normal;font-style: normal;} > P.NORMAL {margin-top: 5pt;margin-bottom: 5pt;font-family: 'Times New > Roman';font-size: 12pt;font-weight: normal;font-style: normal;} > P {margin-top: 0.05pt;margin-bottom: 0.05pt;font-family: > 'Arial';font-size: > 12pt;font-style: normal;} > </STYLE> > </HEAD> > <BODY text=#000000 bgColor=#ffffff> > <P><SPAN style="FONT-SIZE: 10pt">High <IMG height=230 alt=[image] > src="cid:f457094b-602d-42b8-917e-3ee75bff0dd1" width=307 > border=0></SPAN><SPAN > style="FONT-SIZE: 10pt">Joe</SPAN><SPAN style="FONT-SIZE: > 10pt">,</SPAN></P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> > <P><SPAN style="FONT-SIZE: 8.2pt; FONT-FAMILY: 'Microsoft Sans > Serif'"></SPAN> </P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN></P> > <P><SPAN style="FONT-SIZE: 10pt"></SPAN> </P></BODY></HTML> > > There are differences, but none that I can see that would cause the > problem. >
|
|
I've reduced the HTML body to the simplest form possible:
<IMG src=cid:image1>
and still the image gets stripped. I'm setting the following properties on the attachment:
attachment.set_Fields(0x370E001E /*content type*/, "image/jpeg"); attachment.set_Fields(0x3712001E /*PR_ATTACH_CONTENT_ID*/, "image1");
is there any other property that should be set?
|
|
Did you try to make the attachment contents id value the same as the one used by Outlook? Did you compare the two messages in the Sent Items folder with OutlookSpy or MFCMAPI?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1146514813.802251.285140[ at ]y43g2000cwc.googlegroups.com...
[Quoted Text] > I've reduced the HTML body to the simplest form possible: > > <IMG src=cid:image1> > > and still the image gets stripped. I'm setting the following > properties on the attachment: > > attachment.set_Fields(0x370E001E /*content > type*/, "image/jpeg"); > attachment.set_Fields(0x3712001E > /*PR_ATTACH_CONTENT_ID*/, "image1"); > > is there any other property that should be set? >
|
|
The only real difference I see is the value of the PR_RENDERING_POSITION. It's -1 for the one that works and 1 for the one that doesn't.
|
|
Did you try to specify the attachment positon open calling Attachments.Add? What is your code?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1147104763.590528.212310[ at ]j33g2000cwa.googlegroups.com...
[Quoted Text] > The only real difference I see is the value of the > PR_RENDERING_POSITION. It's -1 for the one that works and 1 for the > one that doesn't. >
|
|
I'm not sure what you're asking. Here is my code:
Redemption.Attachment attachment = safeMailItem.Attachments.Add("c:\\showletter.bmp", OlAttachmentType.olByValue, 1, "image1");
|
|
Your code explicitly passes 1. In this case you'd be better off only specifying the very first parameter (file name) and passing empty variant for the rest of the parameters.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1147117966.650304.113020[ at ]v46g2000cwv.googlegroups.com...
[Quoted Text] > I'm not sure what you're asking. Here is my code: > > Redemption.Attachment attachment = > safeMailItem.Attachments.Add("c:\\showletter.bmp", > OlAttachmentType.olByValue, 1, "image1"); >
|
|
I guess the equivalent of empty variant in C# would be null, so I passed that in for the last three parameters and saw no change.
|
|
Save both good (sent by Outlook) and bad (sent by your code) mesasges as MSG files (File | Save As), zip them (important!!!) and send to my private address.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool
<mikebabb[ at ]cableaz.com> wrote in message news:1147186393.680195.21660[ at ]e56g2000cwe.googlegroups.com...
[Quoted Text] >I guess the equivalent of empty variant in C# would be null, so I > passed that in for the last three parameters and saw no change. >
|
|