Re: mail Sensitivity doesn't work as expected(can not set the sensitivity label)

Tim Roberts <[email protected]> Wed, 17 Nov 2021 18:01:01 -0800
Newsgroups gmane.comp.python.windows
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Victor Liu wrote:
>
>
> Gratitude to all the work of the library. I am trying to use it to 
> send out some emails, but I have encountered this issue which might be 
> a bug. It can be represented by this minimum working example.
>
It might perhaps be a bug, but it is not a bug in Python.  All you're 
doing is controlling the Outlook object model.


> ... mail.Sensitivity  =  1
> mail.Send()
>
> This works well expect the |mail.sensitivity =1| part, so it pops up a 
> window to set the sensitivity label(Bear in mind, not all outlook has 
> set up this restriction).
> ... 
> <https://user-images.githubusercontent.com/7195126/141965903-30c23072-d41d-403a-a11c-69e6e98e9c60.png>
> This makes the process is impossible to automate.
>
> My understanding is |mail.sensitivity = 1| is for that Azure label. 
> Please let me know if I missed something.
>
That is certainly not how it is defined.  MailItem.Sensitivity is an 
enumeration of type OISensitivity, where 0=normal, 1=personal, 
2=private, and 3=confidential.  Here's the doc page:

https://docs.microsoft.com/en-us/office/vba/api/outlook.olsensitivity

There is no additional meaning assigned to it.  It's possible your copy 
of Outlook might have additional add-ons that change this behavior, but 
there is nothing you can do about that with COM.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32
smime.p7s (application/pkcs7-signature, 3.3 KB) - not displayed