Question : How SMTP works?

Im trying to understand how SMTP works. How does SMTP know to send an email out to an external address like gmail? I have an SMTP server setup through IIS and its very basic it just has the domain name in the SMTP virtual server. There is no configuration to send it out to any other mail server from the SMTP server. Is it because when it gets a for example address for [email protected] it looks at DNS and just sends it to the gmail smtp server automatically? Thanks

Answer : How SMTP works?

>it looks at DNS

It looks up gmail.com yes, but how it works out where to send it to is to look at gmail.com's MX records.

These can be found by going into a DNS tool such as mxtoolbox.com

http://www.mxtoolbox.com/SuperTool.aspx?action=mx%3agmail.com%2c

As you can see Gmail has 5 of these MX records at the present.  These are:-

5      gmail-smtp-in.l.google.com      209.85.222.34      3600
10      alt1.gmail-smtp-in.l.google.com      209.85.217.17      3600
20      alt2.gmail-smtp-in.l.google.com      74.125.93.27      3600
30      alt3.gmail-smtp-in.l.google.com      216.239.59.27      3600
40      alt4.gmail-smtp-in.l.google.com      209.85.220.66      3600

The reason there's more than one is resilience.  Your email will be passed to the one marked 5 first.  If that server is unavailable it will be passed to the one marked 10, etc. until it is accepted.
Random Solutions  
 
programming4us programming4us