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. C#
  4. System.net.Mail default smtp host

System.net.Mail default smtp host

Scheduled Pinned Locked Moved C#
questioncsharpsysadmin
4 Posts 3 Posters 1 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.
  • O Offline
    O Offline
    oOomen
    wrote on last edited by
    #1

    i was using the old system.web.mail classes. and try to sent emails with net.mail, but i get an exception: System.Net.Mail.SmtpFailedRecipientException was unhandled by user code Message="Mailbox unavailable. The server response was: 5.7.1 Unable to relay for bla@bla.bla" host property of SmtpClient must be set up! but what is default smpt host? is it "localhost"? i get an exception if i use it. if i use this code it work for me (System.Web.Mail): SmtpMail.SmtpServer = null; SmtpMail.Send(mail); because the name of the local SMTP server is used!!!!!! WHAT NAME IS IT? how can i find it out? i need the name to set the property Host of SmtpClient (System.Net.Mail). thanks thank u for ur advice

    B V 2 Replies Last reply
    0
    • O oOomen

      i was using the old system.web.mail classes. and try to sent emails with net.mail, but i get an exception: System.Net.Mail.SmtpFailedRecipientException was unhandled by user code Message="Mailbox unavailable. The server response was: 5.7.1 Unable to relay for bla@bla.bla" host property of SmtpClient must be set up! but what is default smpt host? is it "localhost"? i get an exception if i use it. if i use this code it work for me (System.Web.Mail): SmtpMail.SmtpServer = null; SmtpMail.Send(mail); because the name of the local SMTP server is used!!!!!! WHAT NAME IS IT? how can i find it out? i need the name to set the property Host of SmtpClient (System.Net.Mail). thanks thank u for ur advice

      B Offline
      B Offline
      Bounz
      wrote on last edited by
      #2

      You have to specify SMTP-server, which you will use for sending mail... I did following: myClient = new SmtpClient(serverName, Convert.ToInt32(serverPort)); where serverName is IP-adress of SMTP-server. -- Digitally yours, Bounz

      V 1 Reply Last reply
      0
      • O oOomen

        i was using the old system.web.mail classes. and try to sent emails with net.mail, but i get an exception: System.Net.Mail.SmtpFailedRecipientException was unhandled by user code Message="Mailbox unavailable. The server response was: 5.7.1 Unable to relay for bla@bla.bla" host property of SmtpClient must be set up! but what is default smpt host? is it "localhost"? i get an exception if i use it. if i use this code it work for me (System.Web.Mail): SmtpMail.SmtpServer = null; SmtpMail.Send(mail); because the name of the local SMTP server is used!!!!!! WHAT NAME IS IT? how can i find it out? i need the name to set the property Host of SmtpClient (System.Net.Mail). thanks thank u for ur advice

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        This is a duplicated post. You have also posted in ASP.NET and I have answered it there. The URL to refer for your doubt is: http://www.systemwebmail.com/[^] Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://deepak.blogdrive.com/

        1 Reply Last reply
        0
        • B Bounz

          You have to specify SMTP-server, which you will use for sending mail... I did following: myClient = new SmtpClient(serverName, Convert.ToInt32(serverPort)); where serverName is IP-adress of SMTP-server. -- Digitally yours, Bounz

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          Bounz wrote: myClient = new SmtpClient(serverName, Convert.ToInt32(serverPort)); You may use IPAddress or the Dns Name of the server also. But the quicker trick would be CDOSys can be configured to relay to the local server and have the local server relay to a SmartHost in the network, which would do all relay, authorization checks etc to send the mail. That way, our application is freed up from using a slow costly network communication resource through its process. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://deepak.blogdrive.com/

          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