none
How to find smtp server name??

    Question

  •  

    Hi,

    I am using outlook 2003 with a POP/SMTP account configured.

    I want to retrieve account info.I have added referance to outlook 11.0 object library

     

    using Microsoft.Office.Interop.Outlook;

     

    ApplicationClass app = new ApplicationClass();

    //To retrieve user user email id

    Console.WriteLine(app.Session.CurrentUser.Address);

    //To retrieve user user name

    Console.WriteLine(app.Session.CurrentUser.Name);

     

    But i don't find any method to find smtp server name.

     

    Any idea to find smtp server name

     

    Thanks in advance.

    Wednesday, November 28, 2007 1:42 PM

Answers

  •  

    Hi Sandy,

     

    The SmtpServer Address is not exposed in Outlook 2003. We can only get it in Outlook 2007 like the following:

    Application.Session.GetAccount(1).SmtpAddress.

    More information you can get  in http://msdn2.microsoft.com/en-us/library/bb206801.aspx .

    In Outlook 2003, I think it is unachievable to get that information from Outlook Object Model. But, in the registry, the account information is stored in the following location:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles.

    I can see some related information about the Exchange Server Address in this key. But I am not very sure about SMTP server, for most of the data are in binary format. You can check it at your side. Wish it can help.

     

     

    Thanks

    Ji

    Friday, November 30, 2007 3:40 AM

All replies

  •  

    Hi Sandy,

     

    The SmtpServer Address is not exposed in Outlook 2003. We can only get it in Outlook 2007 like the following:

    Application.Session.GetAccount(1).SmtpAddress.

    More information you can get  in http://msdn2.microsoft.com/en-us/library/bb206801.aspx .

    In Outlook 2003, I think it is unachievable to get that information from Outlook Object Model. But, in the registry, the account information is stored in the following location:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles.

    I can see some related information about the Exchange Server Address in this key. But I am not very sure about SMTP server, for most of the data are in binary format. You can check it at your side. Wish it can help.

     

     

    Thanks

    Ji

    Friday, November 30, 2007 3:40 AM
  • Thanks Ji for your reply.

    Friday, November 30, 2007 7:51 AM