-
Notifications
You must be signed in to change notification settings - Fork 61
/
office.mailboxenums.recipienttype.yml
120 lines (91 loc) · 4.63 KB
/
office.mailboxenums.recipienttype.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
### YamlMime:TSEnum
name: Office.MailboxEnums.RecipientType
uid: 'outlook!Office.MailboxEnums.RecipientType:enum'
package: outlook!
fullName: Office.MailboxEnums.RecipientType
summary: Specifies the type of recipient of a message or appointment.
remarks: >-
\[ [API set: Mailbox 1.1](/javascript/api/requirement-sets/outlook/outlook-api-requirement-sets) \]
**[Applicable Outlook
mode](https://learn.microsoft.com/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points)<!-- -->**:
Compose or Read
**Important**: A `recipientType` property value isn't returned by the
[Office.context.mailbox.item.from.getAsync](https://learn.microsoft.com/javascript/api/outlook/office.from?view=outlook-js-1.7#outlook-office-from-getasync-member(1))
and
[Office.context.mailbox.item.organizer.getAsync](https://learn.microsoft.com/javascript/api/outlook/office.organizer?view=outlook-js-1.7#outlook-office-organizer-getasync-member(1))
methods. The email sender or appointment organizer is always a user whose email address is on the Exchange server.
#### Examples
```TypeScript
// 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}`));
}
```
isPreview: false
isDeprecated: false
fields:
- name: DistributionList
uid: 'outlook!Office.MailboxEnums.RecipientType.DistributionList:member'
package: outlook!
summary: Specifies the recipient is a distribution list containing a list of email addresses.
value: '"distributionList"'
- name: User
uid: 'outlook!Office.MailboxEnums.RecipientType.User:member'
package: outlook!
summary: Specifies the recipient is an SMTP email address on the Exchange server.
value: '"user"'
- name: ExternalUser
uid: 'outlook!Office.MailboxEnums.RecipientType.ExternalUser:member'
package: outlook!
summary: >-
Specifies the recipient is an SMTP email address that isn't on the Exchange server. It also refers to a recipient
added from a personal Outlook address book.
**Important**: In Outlook on the web, on Windows (starting with Version 2210 (Build 15813.20002)), and on Mac,
Global Address Book (GAL) recipients saved to a personal address book return the `ExternalUser` value, even if
their SMTP email address appears on the Exchange server. Recipients return a `User` value only if they're directly
added or resolved against the GAL.
value: '"externalUser"'
- name: Other
uid: 'outlook!Office.MailboxEnums.RecipientType.Other:member'
package: outlook!
summary: >-
Specifies the recipient isn't one of the other recipient types. It also refers to a recipient that isn't resolved
against the Exchange address book, and is therefore treated as an external SMTP address.
**Important**: In Outlook on Android and on iOS, Global Address Book (GAL) recipients saved to a personal
address book return the `Other` value, even if their SMTP email address appears on the Exchange server. Recipients
return a `User` value only if they're directly added or resolved against the GAL.
value: '"other"'