Sender for mail is showing default account RRS feed

  • Question

  • Hi All,

    We have faced one strange issue while working on vsto plug-in (I can reproduce without plug-in also). I have 2 accounts A (default account) and B (other account). When I am sending mail from B, in send item of A, sender in mail appears as A while actually mail in receiver's inbox is appearing a right account i.e. B. 

    Any suggestion, why it is happening. I have already verified settings of "use default account to send" and it is off.

    By searching on internet, I read that it happens if you are not able to send mail using B (might be credential issue), it uses default account. Can somebody confirm ?

    PS: This issue is happening only on one machine with outlook 2016. Rest machines, same accounts are working fine.

    Sunday, September 20, 2020 7:11 PM

All replies

  • You should not be relying on any sender related properties until the item is actually sent. The first time you can access the sent item is when the Items.ItemAdd event fires on the Sent Items folder.

    In the Application.ItemSend event, use the MailItem.Account property instead.

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Sunday, September 20, 2020 7:21 PM
  • Hi Dmitry,

    Thanks for reply. But in this case, mail is already sent and it is available in receiver's mail box.

    Another point is, if I simply see "from" field in outlook in send item (using view-> settings-> columns), it is showing different name.

    Monday, September 21, 2020 3:16 AM
  • Did you use the MailItem.SendUsingAccount property which allows setting an Account object that represents the account under which the MailItem is to be sent?

    Or do you mean the MailItem.SentOnBehalfOfName property which returns a string indicating the display name for the intended sender of the mail message?

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, September 21, 2020 7:26 PM
  • Hi Eugene,

    Thanks for reply. If I see MailItem.SendUsingAccount in send item's mail, it shows me default account not current account. However I am still confused that in which condition / circumstances, my mail is choosing default account as sender instead of current account :--

    1- Because I have verified in compose window, I have set current account.

    2- I have not set any delegation or on behalf of.

    3- It is only reproducible on couple of machines for same account. On rest of machines, it is working fine for same account.

    4- It is happening even if I disable / unload my plug-in.

    Any idea / suggestion ?



    Tuesday, September 22, 2020 4:07 AM