In an Outlook web add-in attached to a Compose Scenario context, we can change the message recipients (e.g. to
) as follows:
Office.context.mailbox.item.to.setAsync(
[
{
displayName: "Allie Bellew",
emailAddress: "[email protected]"
}
], result => console.log(result));
However, the from
property appears to be readonly, even though in the Outlook web GUI I can pretty much set it to arbitrary values by clicking on the From
button (although not all values may be accepted by our mail server of course). Is there a way to modify the sender as well from an Outlook web add-in?
I already tried item.internetHeaders.setAsync
but that seems intended only for X-
prefixed custom headers, so the following call succeeds but has no effect, neither in the GUI nor the sent message.
item.internetHeaders.setAsync({ From: "[email protected]" }, result => console.log(result));
Currently the set API for From address is not a part of the product. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.