Using C# to identify the correct port for emails RRS feed

  • Question

  • H

    I have a C# app which uses the SmtpClient class to send mail via a specified Exchange server. However, sometimes the SmtpClient.Port property needs to be set to something other than 25, i.e. when the Default Receive Connector port is not 25.

    Is there an easy way to identify what the Default Receive Connector port is set to from within the app?

    Any pointers would be gratefully received.



    Friday, August 26, 2011 2:02 PM

All replies

  • Hi,

    which Exchange version are you using?

    for Exchange 2003, you'll need to look into Active Directory. The information is stored there. With Exchange 2007 you can use a Cmdlet to get this info.

    Kind regards,
    Henning Krause

    Thursday, September 1, 2011 4:14 PM