How to figure out the SMTP Server Host? [closed] #
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?
Here is Some Solutions :
Solution 1: #
generally smtp servers name are smtp.yourdomain.com or mail.yourdomain.com open command prompt try to run following two commands
you will most probably get response from any one from the above two commands.and that will be your smtp server
If this doesn’t work open your cpanel –> go to your mailing accounts — > click on configure mail account — > there somewhere in the page you will get the information about your smtp server
it will be written like this way may be :
Incoming Server: mail.yourdomain.com
IMAP Port: —
POP3 Port: —
Outgoing Server: mail.yourdomain.com
SMTP Port: —
Solution 2: #
You can use the dig/host command to look up the MX records to see which mail server is handling mails for this domain.
On Linux you can do it as following for example:
$ host google.com
google.com has address 18.104.22.168
google.com has address 22.214.171.124
google.com has address 126.96.36.199
google.com mail is handled by 10 google.com.s9a2.psmtp.com.
google.com mail is handled by 10 smtp2.google.com.
google.com mail is handled by 10 google.com.s9a1.psmtp.com.
google.com mail is handled by 100 google.com.s9b2.psmtp.com.
google.com mail is handled by 10 smtp1.google.com.
google.com mail is handled by 100 google.com.s9b1.psmtp.com.
(as you can see, google has quite a lot of mail servers)
If you are working with windows, you might use nslookup (?) or try some web tool (e.g. that one) to display the same information.
Although that will only tell you the mail server for that domain. All other settings which are required can’t be gathered that way. You might have to ask the provider.
Solution 3: #
Put this in a batch file named: getmns.bat (get mail name server):
if @%1==@ goto USAGE
echo set type=MX>mnscmd.txt
echo %0 domainname.ext
google.com MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
google.com MX preference = 10, mail exchanger = aspmx.l.google.com
google.com MX preference = 50, mail exchanger = alt4.aspmx.l.google.com
google.com MX preference = 40, mail exchanger = alt3.aspmx.l.google.com
google.com MX preference = 30, mail exchanger = alt2.aspmx.l.google.com
alt4.aspmx.l.google.com internet address = 188.8.131.52
alt3.aspmx.l.google.com internet address = 184.108.40.206
aspmx.l.google.com internet address = 220.127.116.11
alt1.aspmx.l.google.com internet address = 18.104.22.168
alt2.aspmx.l.google.com internet address = 22.214.171.124
For example to pipe the result again into a file do:
getmns google.com > google.mns.txt