.NET Components for Mobility

Get name and address from Email Account

Last post 11-09-2008 7:42 PM by Inophage. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-03-2008 10:05 AM

    Get name and address from Email Account

     hello people

     I´m  trying to get the name and address from a email account:

     

                        EmailAccountCollection col = session.EmailAccounts;

                        foreach (EmailAccount ea in col)
                        {
                            String add = (String)ea.Properties[AccountProperty.SenderEmailAddress];
                            String name = (String)ea.Properties[AccountProperty.SenderName];
                        }

    I dont know if this way it´s right. The problem is that "add" and "name" always return null value;

    Does someone knows other way to get the name and address from a email account? This way is it right?

    thanks

     

     

  • 10-13-2008 1:46 PM In reply to

    Re: Get name and address from Email Account

    These properties may not be present depending on the account type. For POP and IMAP these should return the values as set in the account settings. For Activesync/Exchange the sender name is not stored with the account properties.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 11-08-2008 12:33 PM In reply to

    Re: Get name and address from Email Account

     Hi Peter, these properties always return a null value. Do you know another way to get these propertie ?

     Inophage

    Filed under: ,
  • 11-09-2008 11:42 AM In reply to

    Re: Get name and address from Email Account

    You should also be able to retrieve the email account properties through the configuration API - Look at the EMAIL2 Configuration Service Provider for examples.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 11-09-2008 7:42 PM In reply to

    Re: Get name and address from Email Account

     Ok, I often use the configuration API to create a email account.

    I did not know we could also ask parameters.

    I find this link to query these parameters  http://msdn.microsoft.com/en-us/library/aa456146.aspx

     Thank you Peter.

    Oh, what is different between the microsoft configuration API and ITH configuration API ?

     

    Inophage

Page 1 of 1 (5 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.