Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Automatically determine the smtp server

Automatically determine the smtp server

Scheduled Pinned Locked Moved Visual Basic
csharpsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dom Sinclair
    wrote on last edited by
    #1

    Is there a relatively 'foolproof' way to either determine the smtp server being used by a user of ones program, or alternatively a 'default' setting that one could assign as the smtp host that should work. This is for use in an application that will be utilising system.net.mail for automatic e mailing. I would prefer to avoid having to ask the end user to supply such information during the installation, simply because not all of thenm would know what it is. Most of the searches that I have done around this all seem to include a 'hardcoded' smtp host, which is the one thing I'm trying to avoid. Any suggestions would be greatly appreciated.

    C 1 Reply Last reply
    0
    • D Dom Sinclair

      Is there a relatively 'foolproof' way to either determine the smtp server being used by a user of ones program, or alternatively a 'default' setting that one could assign as the smtp host that should work. This is for use in an application that will be utilising system.net.mail for automatic e mailing. I would prefer to avoid having to ask the end user to supply such information during the installation, simply because not all of thenm would know what it is. Most of the searches that I have done around this all seem to include a 'hardcoded' smtp host, which is the one thing I'm trying to avoid. Any suggestions would be greatly appreciated.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      No. The best you can do is to use the settings for a mail server you know of, that you have the right to use.

      Member 4427614 wrote:

      This is for use in an application that will be utilising system.net.mail for automatic e mailing

      Sounds evil.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      D 1 Reply Last reply
      0
      • C Christian Graus

        No. The best you can do is to use the settings for a mail server you know of, that you have the right to use.

        Member 4427614 wrote:

        This is for use in an application that will be utilising system.net.mail for automatic e mailing

        Sounds evil.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        D Offline
        D Offline
        Dom Sinclair
        wrote on last edited by
        #3

        Christian Thanks for your quick reply, I was starting to think the same, so now I guess I'm going to have to turn my attention to doing an NSLookup during the installation routine and seeing if I can get the information I need from there, unless you have a better idea that is. Dom

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups