How to get email host name

CoachBarker

Well-known member
Joined
Jul 26, 2007
Messages
133
Programming Experience
1-3
In an app where I want to send an email I am using System.Net.Mail. I have it all set up and it should work, I used the same exact code in another app that worked fine. My problem is that I don't know the host name

VB.NET:
 ' Instantiate a new instance of SmtpClient
 Dim mSmtpClient As New SmtpClient()
  ' host name from other application
  ' mSmtpClient.Host = "smtp-host.xxx.edu"
  ' host name from new application
 mSmtpClient.Host = "smtp-host.yyy.edu"
  ' Send the mail message
   mSmtpClient.Send(mMailMessage)

Is there a place on my computer where I can find the Host?

Thanks
CoachBarker
 
normally it only exists on your computer if you have smtp installed. if that's the case use can use "localhost" for it.

if smtp service is installed elsewhere like a computer on your network or your isp then you can get that from your administrator or your isp.
 
Back
Top