Office.MailboxEnums.RecipientType enum

メッセージまたは予定の受信者の種類を指定します。

注釈

[ API セット: メールボックス 1.1 ]

適用できる Outlook モード: 新規作成または読み取り

重要: recipientType プロパティ値は、 Office.context.mailbox.item.from.getAsync メソッドと Office.context.mailbox.item.organizer.getAsync メソッドによって返されません。 メール送信者または予定の開催者は、常に Exchange サーバー上のメール アドレスを持つユーザーです。

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-to-message-read.yaml

const msgTo = Office.context.mailbox.item.to;
const distributionLists = [];
const externalRecipients = [];
const internalRecipients = [];
const otherRecipients = [];
for (let i = 0; i < msgTo.length; i++) {
    switch (msgTo[i].recipientType) {
    case Office.MailboxEnums.RecipientType.DistributionList:
        distributionLists.push(msgTo[i]);
        break;
    case Office.MailboxEnums.RecipientType.ExternalUser:
        externalRecipients.push(msgTo[i]);
        break;
    case Office.MailboxEnums.RecipientType.User:
        internalRecipients.push(msgTo[i]);
        break;
    case Office.MailboxEnums.RecipientType.Other:
        otherRecipients.push(msgTo[i]);
    }
}

if (distributionLists.length > 0) {
    console.log("Distribution Lists:");
    distributionLists.forEach((recipient) => console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}

if (externalRecipients.length > 0) {
    console.log("External Recipients:");
    externalRecipients.forEach((recipient) => console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}

if (internalRecipients.length > 0) {
    console.log("Internal Recipients:");
    internalRecipients.forEach((recipient) => console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}

if (otherRecipients.length > 0) {
    console.log("Other Recipients:");
    otherRecipients.forEach((recipient) => console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}

フィールド

DistributionList = "distributionList"

受信者が電子メール アドレスの一覧を含む配布リストであることを指定します。

User = "user"

受信者が Exchange サーバーの SMTP メール アドレスであることを指定します。

ExternalUser = "externalUser"

受信者が Exchange サーバー上にない SMTP メール アドレスであることを指定します。 また、個人の Outlook アドレス帳から追加された受信者も指します。

重要: Outlook on Windows (バージョン 2210 (ビルド 15813.20002 以降))、Mac、および Web 上では、個人用アドレス帳に保存されたグローバル アドレス帳 (GAL) 受信者は、SMTP メール アドレスが Exchange サーバーに表示されている場合でも値を返 ExternalUser します。 受信者は、GAL に User 対して直接追加または解決された場合にのみ値を返します。

Other = "other"

受信者が他の受信者の種類の 1 つではないことを指定します。 また、Exchange アドレス帳に対して解決されない受信者も参照するため、外部 SMTP アドレスとして扱われます。

重要: Outlook on Android および iOS では、個人用アドレス帳に保存されたグローバル アドレス帳 (GAL) の受信者は、SMTP メール アドレスが Exchange サーバーに表示されている場合でも、値を返 Other します。 受信者は、GAL に User 対して直接追加または解決された場合にのみ値を返します。