Search code examples
outlookoffice-jsoutlook-addinoffice-addinsoutlook-web-addins

Changing Account with "on-send" feature?


I have a customer with multiple users, they have two emails accounts on two differents domains.

One is managed by Office365 : Teams / Calendar, example : @my-business.com Second is for "secure" communication, exemple : @my-secure-email.com

The second one is really not used very often but the emails sent or received must absolutely not go on Office365 (legal reason)

I want to force user to send emails to *[email protected] with second account.

With "on-send Feature" i think i can "block" emails but ideally it should be possible to dynamically change the account used in Outlook according to the recipient's address ?

EDIT to clarify :

  • Is it possible to change sender account with office-js and "on sender" feature on office365 ?

  • Is it possible to change sender account direclty in Outlook for Windows based on recipient address ?

Thanks

Guldil


Solution

  • Is it possible to change sender account with office-js and "on sender" feature on office365 ?

    No, it is not possible. OfficeJS doesn't provide anything for that.

    Is it possible to change sender account direclty in Outlook for Windows based on recipient address ?

    Yes, you can choose the sender's account in Outlook manually or by using a VSTO add-in instead. The MailItem.SendUsingAccount property is available in the Outlook object model (available for VBA macros and COM based add-ins). The property allows setting an Account object that represents the account under which the MailItem is to be sent.

    But web add-ins work under the context of currently selected item only (or in case of UI-less add-ins what they activated for) and don't provide access to application-wide features like choosing email account to send from.

    You can post or vote for an existing feature request on Tech Community where they are considered when the Office dev team go through the planning process. Use the github label: Type: product feature request at https://aka.ms/M365dev-suggestions .