指示电子邮件的类型 [英] Indicating the type of the email
本文介绍了指示电子邮件的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下自动化程序,该程序将添加了特定链接的电子邮件发送给自己:
I have the following automation program, that sends the email to myself with a specific link added:
import win32com.client as win32
import easygui
import tkinter as to
from tkinter import filedialog
import pywinauto
import pywinauto.controls
from pywinauto.application import Application
### easygui commands asking user for the inputs
fieldNames_text= ['','']
fieldNames= ['Subject','Link']
INPUT = easygui.multenterbox('Please fill in', 'FIN and PASSWORD', fieldNames, fieldNames_text)
answer = easygui.ynbox('Any attachement?', 'Attachement', ('Yes', 'No'))
### outlook handling
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = 'name.surname@company.com'
mail.Subject = INPUT[0]
mail.Body = INPUT[1]
### attachment addition
if answer == True:
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename()
mail.Attachments.Add(file_path)
else:
pass
### mail sending
mail.Send()
但是,根据公司规则,用户应指明电子邮件类型(公共、通用、机密等).
However, as per the corporate rules, the user should indicate the type of email (Public, General, Secret, etc.).
这应该在 Outlook 消息窗格本身中定义:
This should be defined in the outlook Message pane itself:
有没有办法在 win32
Outlook 处理中指明电子邮件类型?
Is there a way to indicate email type within win32
outlook handling?
推荐答案
使用 MailItem.Sensitivity 属性,它在 OlSensitivity enumeration 指示 Outlook 项目的敏感度
Use MailItem.Sensitivity property which sets a constant in the OlSensitivity enumeration indicating the sensitivity for the Outlook item
示例
mail.Sensitivity = 3
mail.Send()
+----------------+-------+--------------------+
| Name | Value | Description |
+----------------+-------+--------------------+
| olConfidential | 3 | Confidential |
| olNormal | 0 | Normal sensitivity |
| olPersonal | 1 | Personal |
| olPrivate | 2 | Private |
+----------------+-------+--------------------+
这篇关于指示电子邮件的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文