none
SendUsingAccount.SmtpAddress keeps returning null RRS feed

  • Question

  • Hey,

    This value keeps coming back as null, yet there is an account there?

    sender = mailItem.SendUsingAccount.SmtpAddress;

    Suggestions?

    Wednesday, December 9, 2015 6:41 PM

Answers

  • MailItem.SendUsingAccount will be null on the outgoing emails unless it is explicitly set. Use  Aplication.Session.CurrentUser.AddressEntry. For Exchange accounts, (AddressEntry.Type == "EX"), use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, December 9, 2015 11:08 PM

All replies

  • Hello Darryl,

    When the default (single) account is used you need to use the Namespace.CurrentUser.Address/AddressEntry property instead.

    Wednesday, December 9, 2015 7:45 PM
  • MailItem.SendUsingAccount will be null on the outgoing emails unless it is explicitly set. Use  Aplication.Session.CurrentUser.AddressEntry. For Exchange accounts, (AddressEntry.Type == "EX"), use AddressEntry.GetExchangeUser.PrimarySmtpAddress.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, December 9, 2015 11:08 PM