How to get the SMTP server from email address

后端 未结 4 1663
说谎
说谎 2021-01-28 21:43

I want to send mail automatically by special email account, but now, I only know the email address: tsp.monitor@qorosauto.com , and the password. so do you know how to get the

4条回答
  •  忘掉有多难
    2021-01-28 22:24

    You find the SMTP server of a domain by taking the host part of the email address (qorosauto.com in your example) and looking up the MX record for it.

    $ dig +short mx qorosauto.com
    10 euq2.qorosauto.com.
    5 euq1.qorosauto.com.
    

    The number before the hostname indicate preference - in this case euq1.qorosauto.com is the preferred server to connect to.

    Doing this in .Net is not straight-forward, as the answer to this question indicates: How to get mx records for a dns name with System.Net.DNS?

    To add to the problems, many ISPs will filter your connection in the firewall and won't let you talk to any SMTP server except the ISPs one, which in turn will relay the mail to the recipient.

    Essentially, you want to use your ISPs or organizations SMTP server - not the recipients MX.

提交回复
热议问题