如何向电子邮件添加自定义 Internet 标头? [英] How to add custom internet headers to emails?

查看:89
本文介绍了如何向电子邮件添加自定义 Internet 标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以提供如何创建自定义 Internet 标题并将其添加到 mailItem 以及以后如何阅读它们吗?我正在尝试在发送的每封电子邮件中附加一个关键字,以便其他 Outlook 客户端使用相同的加载项读取.

Can someone provide how to create and add custom internet headers to the mailItem and how to read them later? I am trying to attach a keyword to every email that is sent so it can be read by another outlook client with the same add-in.

推荐答案

假设您正在编写 Outlook 插件(基于您的标签).获取当前邮件项目的句柄(草稿形式的电子邮件)...

Assuming you're writing a Outlook Plugin (based on your tag). Get a Handle on your current mail item (email in draft form)...

// Describes your Custom Header
string  PS_INTERNET_HEADERS = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/Custom-Property-Name";

// Sets Your Custom Header
CurrentMailItem.PropertyAccessor.SetProperty(PS_INTERNET_HEADERS, "ValueOfCustomProperty" );

// Reads Your Custom Header
string valueResult = CurrentMailItem.PropertyAccessor.GetProperty(PS_INTERNET_HEADERS);

你可能会像这样逃脱:

// Sets Your Custom Header
CurrentMailItem.PropertyAccessor.SetProperty("CustomHeaderName", "ValueOfCustomProperty" );

// Reads Your Custom Header
string valueResult = CurrentMailItem.PropertyAccessor.GetProperty("CustomHeaderName");

另外,请查看:https://social.msdn.microsoft.com/Forums/office/en-US/b4218b03-d495-459f-a112-8d4e1e05ad3e/set-custom-headers-to-outlook-mailitem?forum=outlookdev

这篇关于如何向电子邮件添加自定义 Internet 标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆