Interop.Outlook.UserProperties.Add causing problem during connection time

Posted by Akie on Stack Overflow See other posts from Stack Overflow or by Akie
Published on 2010-12-27T03:50:13Z Indexed on 2010/12/27 3:54 UTC
Read the original article Hit count: 365

Filed under:
|
|
|
|

Hi All,

I have created a plug-in for outlook. Plug-in has only below code.

private void OnNewOutlookInspector(Outlook.Inspector OutlookInsptr)
    {          
        Outlook.MailItem MlItem = (Outlook.MailItem)OutlookInsptr.CurrentItem;

        //if I remove below line. Everything is working fine.
        MlItem.UserProperties.Add("INSPINIT", Outlook.OlUserPropertyType.olText   , true , true ).Value = "1";            

    }

    public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
    {
        applicationObject = application;
        addInInstance = addInInst;

        MessageBox.Show("in connection new 2");
        OutlkApp = (Outlook.Application)application;
        OutlkInsptrs = OutlkApp.Inspectors;
        OutlkInsptrs.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(OnNewOutlookInspector);

    }

Problem I am facing is, When I send HTML mail while plug-in is enabled, receiving end it is being received as a plain text. Below is the mail content along with the header and body at recieving end.

    x-sender: [email protected]
x-receiver: [email protected]
Received: from blr-s-07.pointcrossblr.com ([192.168.1.107]) by blr-ws-134.pointcrossblr.com with Microsoft 

SMTPSVC(6.0.2600.5949);
     Wed, 22 Dec 2010 17:11:02 +0530
Received: from blrws134 ([192.168.1.175]) by blr-s-07.pointcrossblr.com with Microsoft SMTPSVC(6.0.3790.4675);
     Wed, 22 Dec 2010 17:11:02 +0530
From: "Ashif Nataliya" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Subject: RTF FRM blr to pc.com cc blr-ws-134
Date: Wed, 22 Dec 2010 17:11:02 +0530
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="----=_NextPart_000_00F7_01CBA1FB.36115580"
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us
X-MS-TNEF-Correlator: 00000000DCB2344DE8F50F4FBC91085BB5C06D55A4172000
thread-index: AcuhzRuTOBkvHPUnS1aLi9+cHNAWhA==
Return-Path: [email protected]
X-OriginalArrivalTime: 22 Dec 2010 11:41:02.0822 (UTC) FILETIME=[1C788860:01CBA1CD]

This is a multipart message in MIME format.

------=_NextPart_000_00F7_01CBA1FB.36115580
Content-Type: text/plain;
    charset="us-ascii"
Content-Transfer-Encoding: 7bit

HTML Test
Test Mail


------=_NextPart_000_00F7_01CBA1FB.36115580
Content-Type: application/ms-tnef;
    name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
    filename="winmail.dat" 
   // and some other code.....

Any help is appreciated. Thanks.

© Stack Overflow or respective owner

Interop.Outlook.UserProperties.Add causing problem during connection time

Posted by aanataliya on Super User See other posts from Super User or by aanataliya
Published on 2010-12-27T04:43:00Z Indexed on 2010/12/27 4:55 UTC
Read the original article Hit count: 365

Filed under:
|
|
|
|

Hi All,

I have created a plug-in for outlook. Plug-in has only below code.

    private void OnNewOutlookInspector(Outlook.Inspector OutlookInsptr)
        {          
            Outlook.MailItem MlItem = (Outlook.MailItem)OutlookInsptr.CurrentItem;

            //if I remove below line. Everything is working fine.
            MlItem.UserProperties.Add("INSPINIT", Outlook.OlUserPropertyType.olText   , true , true ).Value = "1";            

        }

  public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
  {
   applicationObject = application;
   addInInstance = addInInst;

            MessageBox.Show("in connection new 2");
            OutlkApp = (Outlook.Application)application;
            OutlkInsptrs = OutlkApp.Inspectors;
            OutlkInsptrs.NewInspector += new Outlook.InspectorsEvents_NewInspectorEventHandler(OnNewOutlookInspector);

  }

Problem I am facing is, When I send HTML mail while plug-in is enabled, receiving end it is being received as a plain text. Below is the mail content along with the header and body at recieving end.

    x-sender: [email protected]
x-receiver: [email protected]
Received: from blr-s-07.pointcrossblr.com ([192.168.1.107]) by blr-ws-134.pointcrossblr.com with Microsoft 

SMTPSVC(6.0.2600.5949);
  Wed, 22 Dec 2010 17:11:02 +0530
Received: from blrws134 ([192.168.1.175]) by blr-s-07.pointcrossblr.com with Microsoft SMTPSVC(6.0.3790.4675);
  Wed, 22 Dec 2010 17:11:02 +0530
From: "Ashif Nataliya" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Subject: RTF FRM blr to pc.com cc blr-ws-134
Date: Wed, 22 Dec 2010 17:11:02 +0530
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----=_NextPart_000_00F7_01CBA1FB.36115580"
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us
X-MS-TNEF-Correlator: 00000000DCB2344DE8F50F4FBC91085BB5C06D55A4172000
thread-index: AcuhzRuTOBkvHPUnS1aLi9+cHNAWhA==
Return-Path: [email protected]
X-OriginalArrivalTime: 22 Dec 2010 11:41:02.0822 (UTC) FILETIME=[1C788860:01CBA1CD]

This is a multipart message in MIME format.

------=_NextPart_000_00F7_01CBA1FB.36115580
Content-Type: text/plain;
 charset="us-ascii"
Content-Transfer-Encoding: 7bit

HTML Test
Test Mail


------=_NextPart_000_00F7_01CBA1FB.36115580
Content-Type: application/ms-tnef;
 name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="winmail.dat" 
   // and some other code.....

Any help is appreciated. Thanks.

© Super User or respective owner

Related posts about c#

Related posts about mime