![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I am developing an "encryption type" plug-in to Outlook 2003 using
C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#2
|
|||
|
|||
![]()
Outlook does not remove aan image from the message attachments, it is still
there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#3
|
|||
|
|||
![]()
Thanks for the reply. I checked with OutlookSpy and all the flags seem
to be set correctly. I am pasting the tags from OutlookSpy. PR_ATTACH_CONTENT_ID_W PT_UNICODE PR_ATTACH_FILENAME PT_STRING8 image001.gif PR_ATTACH_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_LONG_FILENAME PT_STRING8 image001.gif PR_ATTACH_LONG_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_METHOD PT_LONG 1 PR_ATTACH_MIME_TAG_W PT_UNICODE image/gif PR_ATTACH_NUM PT_LONG 0 PR_ATTACH_SIZE PT_LONG 27289 PR_ATTACH_TAG PT_BINARY cb:9, lpb: 2A 86 48 86 F7 14 03 0A 04 PR_RECORD_KEY PT_BINARY cb:4, lpb: A5 06 01 00 PR_RENDERING_POSITION PT_LONG -1 And, in the HTMLBody, I am actually setting the same data that I get in the send-event handler. I am doing it manually in the debugger, so the HTMLBody is the same. The HTMLBody segment is he body lang=EN-US link=blue vlink=purple\r\n\r\ndiv class=Section1\r\n\r\np class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;\r\nfont-family:Arial'img width=640 height=480 id=\"_x0000_i1025\"\r\nsrc=\"cid:image001.gif@01C7 2FEE.732ADFA0\"…123456…o ![]() ![]() Also, if i simply close the inspector window with the red-cross mark and re-open, i get the image correctly. So I guess there is something I am missing when I set the HTMLBody manually in the mail-item open event handler and let outlook display it, and when compared to outlook directly openning the email with email body set appropriately. Dmitry Streblechenko wrote: Outlook does not remove aan image from the message attachments, it is still there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#4
|
|||
|
|||
![]()
But HTMLBody is different from the original body on the receiving side,
right? If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. Why not modify the message when it is received rather than justs before it is displayed? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... Thanks for the reply. I checked with OutlookSpy and all the flags seem to be set correctly. I am pasting the tags from OutlookSpy. PR_ATTACH_CONTENT_ID_W PT_UNICODE PR_ATTACH_FILENAME PT_STRING8 image001.gif PR_ATTACH_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_LONG_FILENAME PT_STRING8 image001.gif PR_ATTACH_LONG_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_METHOD PT_LONG 1 PR_ATTACH_MIME_TAG_W PT_UNICODE image/gif PR_ATTACH_NUM PT_LONG 0 PR_ATTACH_SIZE PT_LONG 27289 PR_ATTACH_TAG PT_BINARY cb:9, lpb: 2A 86 48 86 F7 14 03 0A 04 PR_RECORD_KEY PT_BINARY cb:4, lpb: A5 06 01 00 PR_RENDERING_POSITION PT_LONG -1 And, in the HTMLBody, I am actually setting the same data that I get in the send-event handler. I am doing it manually in the debugger, so the HTMLBody is the same. The HTMLBody segment is he body lang=EN-US link=blue vlink=purple\r\n\r\ndiv class=Section1\r\n\r\np class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;\r\nfont-family:Arial'img width=640 height=480 id=\"_x0000_i1025\"\r\nsrc=\"cid:image001.gif@01C7 2FEE.732ADFA0\"…123456…o ![]() ![]() Also, if i simply close the inspector window with the red-cross mark and re-open, i get the image correctly. So I guess there is something I am missing when I set the HTMLBody manually in the mail-item open event handler and let outlook display it, and when compared to outlook directly openning the email with email body set appropriately. Dmitry Streblechenko wrote: Outlook does not remove aan image from the message attachments, it is still there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#5
|
|||
|
|||
![]()
But HTMLBody is different from the original body on the receiving side,
right? Yes. Right now I am doing everything manually in the debugger (like copying the contents of HTMLBody bef actually modifying it and redoing the same in open event) and can get the same behaviour programatically. If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. This explains exactly what I have been looking for. Thanks a lot. As you suggested, I tried to modify when I receive the message, and it works. But my application cannot store decrypted messages in outlook and that is why I have to place the decryption part in the mail-item open event handler. (While closing, I actually put-back the encoded data). Is there any work-around for manipulating outlook reparsing the attachments in the Open event handler. Dmitry Streblechenko wrote: But HTMLBody is different from the original body on the receiving side, right? If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. Why not modify the message when it is received rather than justs before it is displayed? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... Thanks for the reply. I checked with OutlookSpy and all the flags seem to be set correctly. I am pasting the tags from OutlookSpy. PR_ATTACH_CONTENT_ID_W PT_UNICODE PR_ATTACH_FILENAME PT_STRING8 image001.gif PR_ATTACH_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_LONG_FILENAME PT_STRING8 image001.gif PR_ATTACH_LONG_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_METHOD PT_LONG 1 PR_ATTACH_MIME_TAG_W PT_UNICODE image/gif PR_ATTACH_NUM PT_LONG 0 PR_ATTACH_SIZE PT_LONG 27289 PR_ATTACH_TAG PT_BINARY cb:9, lpb: 2A 86 48 86 F7 14 03 0A 04 PR_RECORD_KEY PT_BINARY cb:4, lpb: A5 06 01 00 PR_RENDERING_POSITION PT_LONG -1 And, in the HTMLBody, I am actually setting the same data that I get in the send-event handler. I am doing it manually in the debugger, so the HTMLBody is the same. The HTMLBody segment is he body lang=EN-US link=blue vlink=purple\r\n\r\ndiv class=Section1\r\n\r\np class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;\r\nfont-family:Arial'img width=640 height=480 id=\"_x0000_i1025\"\r\nsrc=\"cid:image001.gif@01C7 2FEE.732ADFA0\"…123456…o ![]() ![]() Also, if i simply close the inspector window with the red-cross mark and re-open, i get the image correctly. So I guess there is something I am missing when I set the HTMLBody manually in the mail-item open event handler and let outlook display it, and when compared to outlook directly openning the email with email body set appropriately. Dmitry Streblechenko wrote: Outlook does not remove aan image from the message attachments, it is still there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#6
|
|||
|
|||
![]()
But HTMLBody is different from the original body on the receiving side,
right? Yes. Right now I am doing everything manually in the debugger (like copying the contents of HTMLBody bef actually modifying it and redoing the same in open event) and can get the same behaviour programatically. If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. This explains exactly what I have been looking for. Thanks a lot. As you suggested, I tried to modify when I receive the message, and it works. But my application cannot store decrypted messages in outlook and that is why I have to place the decryption part in the mail-item open event handler. (While closing, I actually put-back the encoded data). Is there any work-around for manipulating outlook reparsing the attachments in the Open event handler. Dmitry Streblechenko wrote: But HTMLBody is different from the original body on the receiving side, right? If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. Why not modify the message when it is received rather than justs before it is displayed? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... Thanks for the reply. I checked with OutlookSpy and all the flags seem to be set correctly. I am pasting the tags from OutlookSpy. PR_ATTACH_CONTENT_ID_W PT_UNICODE PR_ATTACH_FILENAME PT_STRING8 image001.gif PR_ATTACH_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_LONG_FILENAME PT_STRING8 image001.gif PR_ATTACH_LONG_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_METHOD PT_LONG 1 PR_ATTACH_MIME_TAG_W PT_UNICODE image/gif PR_ATTACH_NUM PT_LONG 0 PR_ATTACH_SIZE PT_LONG 27289 PR_ATTACH_TAG PT_BINARY cb:9, lpb: 2A 86 48 86 F7 14 03 0A 04 PR_RECORD_KEY PT_BINARY cb:4, lpb: A5 06 01 00 PR_RENDERING_POSITION PT_LONG -1 And, in the HTMLBody, I am actually setting the same data that I get in the send-event handler. I am doing it manually in the debugger, so the HTMLBody is the same. The HTMLBody segment is he body lang=EN-US link=blue vlink=purple\r\n\r\ndiv class=Section1\r\n\r\np class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;\r\nfont-family:Arial'img width=640 height=480 id=\"_x0000_i1025\"\r\nsrc=\"cid:image001.gif@01C7 2FEE.732ADFA0\"…123456…o ![]() ![]() Also, if i simply close the inspector window with the red-cross mark and re-open, i get the image correctly. So I guess there is something I am missing when I set the HTMLBody manually in the mail-item open event handler and let outlook display it, and when compared to outlook directly openning the email with email body set appropriately. Dmitry Streblechenko wrote: Outlook does not remove aan image from the message attachments, it is still there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
#7
|
|||
|
|||
![]()
Doesn't sound like the most secure approach - what happens if the user hits
Save when the message is displayed and then Outlook crashes or your add-in becomes disabled? Sounds like an ideal candidate for a custom form - you will never have to put unencrypted data back, but you can display pretty much anaything you want in your custom form. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... But HTMLBody is different from the original body on the receiving side, right? Yes. Right now I am doing everything manually in the debugger (like copying the contents of HTMLBody bef actually modifying it and redoing the same in open event) and can get the same behaviour programatically. If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. This explains exactly what I have been looking for. Thanks a lot. As you suggested, I tried to modify when I receive the message, and it works. But my application cannot store decrypted messages in outlook and that is why I have to place the decryption part in the mail-item open event handler. (While closing, I actually put-back the encoded data). Is there any work-around for manipulating outlook reparsing the attachments in the Open event handler. Dmitry Streblechenko wrote: But HTMLBody is different from the original body on the receiving side, right? If I remember correctly, Outlook does not reparse the attachments collection when HTML body with cid's is set. Why not modify the message when it is received rather than justs before it is displayed? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... Thanks for the reply. I checked with OutlookSpy and all the flags seem to be set correctly. I am pasting the tags from OutlookSpy. PR_ATTACH_CONTENT_ID_W PT_UNICODE PR_ATTACH_FILENAME PT_STRING8 image001.gif PR_ATTACH_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_LONG_FILENAME PT_STRING8 image001.gif PR_ATTACH_LONG_FILENAME_W PT_UNICODE image001.gif PR_ATTACH_METHOD PT_LONG 1 PR_ATTACH_MIME_TAG_W PT_UNICODE image/gif PR_ATTACH_NUM PT_LONG 0 PR_ATTACH_SIZE PT_LONG 27289 PR_ATTACH_TAG PT_BINARY cb:9, lpb: 2A 86 48 86 F7 14 03 0A 04 PR_RECORD_KEY PT_BINARY cb:4, lpb: A5 06 01 00 PR_RENDERING_POSITION PT_LONG -1 And, in the HTMLBody, I am actually setting the same data that I get in the send-event handler. I am doing it manually in the debugger, so the HTMLBody is the same. The HTMLBody segment is he body lang=EN-US link=blue vlink=purple\r\n\r\ndiv class=Section1\r\n\r\np class=MsoNormalfont size=2 face=Arialspan style='font-size:10.0pt;\r\nfont-family:Arial'img width=640 height=480 id=\"_x0000_i1025\"\r\nsrc=\"cid:image001.gif@01C7 2FEE.732ADFA0\"…123456…o ![]() ![]() Also, if i simply close the inspector window with the red-cross mark and re-open, i get the image correctly. So I guess there is something I am missing when I set the HTMLBody manually in the mail-item open event handler and let outlook display it, and when compared to outlook directly openning the email with email body set appropriately. Dmitry Streblechenko wrote: Outlook does not remove aan image from the message attachments, it is still there, Outlook simply adds an extra property (PR_ATTACH_CONTENT_ID) to correlate the img tag with the attachment. Is the property correctly set on teh attachment? Does your HTML body specify the right value of the cid attributes in the img tags? Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Krishna" wrote in message ups.com... I am developing an "encryption type" plug-in to Outlook 2003 using C# based on Outlook Object Model. I am having trouble when the email has an inline image, i.e. when an image is pasted into the email message body. I understand that the image is referenced with a CID and it is actually transmitted as an attachment. Here is my problem. On the receiving side, when does outlook actually remove the image from attachment and place it inline in the email message. When I place my decryption code in mail-item open event-handler, the image is not shown and instead a red-cross mark is shown. All I do is in the mail-item open event-handler; I read the received email body, decrypt it and set the HTMLBody to the decrypted data. But, if I close the inspector and let outlook open the same decrypted message; I get back the email with the inline image. (I am not doing any encryption to the attachment.) Are there any flags that I should set in addition to setting the HTMLBody of the mail-item in the receiving side. Any help/suggestion is greatly appreciated. Thanks, Krishna. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Image added in Signature shows as attachment | Sivakumar | Outlook - Using Forms | 0 | October 4th 06 06:40 AM |
Remove attachment button and remove menu "Insert" from compose mail form? | [email protected] | Outlook - Using Forms | 1 | September 6th 06 12:58 PM |
Viewing image attachment within Outlook? | GoldLexus | Outlook - General Queries | 1 | July 13th 06 05:00 AM |
scan image as attachment | James | Outlook - General Queries | 8 | June 28th 06 05:42 PM |
How to get attachment if image is pasted in body itself. | Vinayakc | Add-ins for Outlook | 3 | February 17th 06 05:17 PM |