Seeking help on email automation

Hi , I was automating outlook 2016 with python. I was using the below code.
import win32com.client as win32
outlook = win32.Dispatch(‘outlook.application’)
mail = outlook.CreateItem(0)
mailTo = ‘abc.xy.xom’
mail.Subject = ‘test’
mail.Sensitivity = 3

now a days, outlook has an extra level of protection of what type of mail this is. So whenever I try to send a mail one pop up box will get opened titled as " Microsoft Azure Information Protection". we need click on “private” or “Confidential” etc then click on Send then mail goes. Can anyone tell me how it should be achieved with python Script? mail.Sensitivity = 3 I used but it didn’t work.

Can anyone help?

If you look at the headers of an email which has the Information Protection applied, then you should see some fields populated. In the headers it will be something like Information Protection=Confidential but could also contains some random strings. If you copy this over and add these headers to your mail, then it should work.

Note: you can view headers in outlook by file > properties > Internet headers