How to figure out the SMTP server host?

Krishna Kant Sharma picture Krishna Kant Sharma · Sep 22, 2009 · Viewed 267.3k times · Source

I am using SMTP to send emails by PHP. My client has a shared hosting. I created an email account there.

There is no information available about what will be the SMTP server for this account. I have tried: smtp.domainname.com But it's not able to connect.

How can I figure out my SMTP server host? any idea?

Answer

Jordan S. Jones picture Jordan S. Jones · Sep 22, 2009

this really is a question for Serverfault.

Windows:

  1. Open up a command prompt (CMD.exe)
  2. Type nslookup and hit enter
  3. Type set type=MX and hit enter
  4. Type the domain name and hit enter, for example: google.com
  5. The results will be a list of host names that are set up for SMTP

Linux:

  1. Open a command prompt
  2. Type dig domain.name MX and hit enter where domain.name is the domain you are trying to find out the smtp server for.

If you do not get any answers back from your dns server, there is a good chance that there isn't any SMTP Servers set up for that domain. If this is the case, do like other's have suggested and call the hosting companies tech support.