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 SMTP server. below is my C# code:
我想通过特殊的电子邮件帐户自动发送邮件,但现在,我只知道电子邮件地址:tsp.monitor@qorosauto.com和密码。所以你知道如何获得SMTP服务器。下面是我的C#代码:
SmtpClient client = new SmtpClient();
client.Host = "What is the SMTP Server, I want to get from email address, can you help me";
string account = "tsp.monitor@qorosauto.com";
string password = "Qoros111";
client.Port = 587;
client.EnableSsl = true;
client.Timeout = 100000;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(account, password);
4 个解决方案
#1
3
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.
您可以通过获取电子邮件地址的主机部分(在您的示例中为qorosauto.com)并查找MX记录来查找域的SMTP服务器。
$ 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.
主机名前面的数字表示首选项 - 在这种情况下,euq1.qorosauto.com是要连接的首选服务器。
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?
在.Net中执行此操作并不是直截了当的,因为此问题的答案表明:如何使用System.Net.DNS获取dns名称的mx记录?
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.
为了解决这些问题,许多ISP将过滤您在防火墙中的连接,并且不允许您与除ISP之外的任何SMTP服务器通信,而ISP会将邮件中继到收件人。
Essentially, you want to use your ISPs or organizations SMTP server - not the recipients MX.
基本上,您希望使用您的ISP或组织SMTP服务器 - 而不是收件人MX。
#2
0
Trial and error might get you there..
试错可能会让你到那里..
- mail.quorosauto.com
- mail.quorosauto.com
- smtp.quorosauto.com
- smtp.quorosauto.com
- www.quorosauto.com
- www.quorosauto.com
- smtp.gmail.com
- smtp.gmail.com
If you've exausted every possibility you'll need to provide your own SMTP server. There are a few freebie servers:
如果您已经充分考虑了所有可能性,则需要提供自己的SMTP服务器。有一些免费服务器:
http://freesmtpservers.com/
However if you are doing this professionally you probably want to use the SMTP server of your organization so you probably want to ask your boss or a colleague.
但是,如果您这样做是专业的,您可能想要使用组织的SMTP服务器,因此您可能想要询问您的老板或同事。
#3
0
You may try mail.orosauto.com or smtp.orosauto.com. Login to you domain account and check mail settings. hopefully you can find the mail server details over there.
您可以尝试mail.orosauto.com或smtp.orosauto.com。登录您的域帐户并检查邮件设置。希望你能在那里找到邮件服务器的详细信息。
#4
0
To find out the responsible mail server you have to ask the DNS. By using the web for example go to this nslookup page.
要找出负责任的邮件服务器,您必须询问DNS。例如,通过使用Web访问此nslookup页面。
Normally you start at the domain server of your provider, but you can also start with a root-server (e.g. 198.41.0.4) and ask for the domain google.com
and the query type MX - Mail exchange
.
通常,您从提供商的域服务器开始,但您也可以从根服务器(例如198.41.0.4)开始,并请求域google.com和查询类型MX - Mail交换。
You'll get back a list of responsible dns server. Simply pick one out of the list (e.g. 192.26.92.30) and send the same query again to this server. Rerun this sequence till you'll get a list of type MX
. Simply pick one address out of this list (maybe the first, maybe the one with the lost value in preference) and use this to establish your smtp connection.
您将获得一个负责任的DNS服务器列表。只需从列表中选择一个(例如192.26.92.30)并再次向该服务器发送相同的查询。重新运行此序列,直到您获得MX类型列表。只需从此列表中选择一个地址(可能是第一个,也许是优先丢失的值)并使用它来建立您的smtp连接。
That's the way how every mail server does its work. Now it is up to you to implement that into your application. ;-)
这就是每个邮件服务器如何工作的方式。现在,您可以将它实现到您的应用程序中。 ;-)
#1
3
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.
您可以通过获取电子邮件地址的主机部分(在您的示例中为qorosauto.com)并查找MX记录来查找域的SMTP服务器。
$ 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.
主机名前面的数字表示首选项 - 在这种情况下,euq1.qorosauto.com是要连接的首选服务器。
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?
在.Net中执行此操作并不是直截了当的,因为此问题的答案表明:如何使用System.Net.DNS获取dns名称的mx记录?
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.
为了解决这些问题,许多ISP将过滤您在防火墙中的连接,并且不允许您与除ISP之外的任何SMTP服务器通信,而ISP会将邮件中继到收件人。
Essentially, you want to use your ISPs or organizations SMTP server - not the recipients MX.
基本上,您希望使用您的ISP或组织SMTP服务器 - 而不是收件人MX。
#2
0
Trial and error might get you there..
试错可能会让你到那里..
- mail.quorosauto.com
- mail.quorosauto.com
- smtp.quorosauto.com
- smtp.quorosauto.com
- www.quorosauto.com
- www.quorosauto.com
- smtp.gmail.com
- smtp.gmail.com
If you've exausted every possibility you'll need to provide your own SMTP server. There are a few freebie servers:
如果您已经充分考虑了所有可能性,则需要提供自己的SMTP服务器。有一些免费服务器:
http://freesmtpservers.com/
However if you are doing this professionally you probably want to use the SMTP server of your organization so you probably want to ask your boss or a colleague.
但是,如果您这样做是专业的,您可能想要使用组织的SMTP服务器,因此您可能想要询问您的老板或同事。
#3
0
You may try mail.orosauto.com or smtp.orosauto.com. Login to you domain account and check mail settings. hopefully you can find the mail server details over there.
您可以尝试mail.orosauto.com或smtp.orosauto.com。登录您的域帐户并检查邮件设置。希望你能在那里找到邮件服务器的详细信息。
#4
0
To find out the responsible mail server you have to ask the DNS. By using the web for example go to this nslookup page.
要找出负责任的邮件服务器,您必须询问DNS。例如,通过使用Web访问此nslookup页面。
Normally you start at the domain server of your provider, but you can also start with a root-server (e.g. 198.41.0.4) and ask for the domain google.com
and the query type MX - Mail exchange
.
通常,您从提供商的域服务器开始,但您也可以从根服务器(例如198.41.0.4)开始,并请求域google.com和查询类型MX - Mail交换。
You'll get back a list of responsible dns server. Simply pick one out of the list (e.g. 192.26.92.30) and send the same query again to this server. Rerun this sequence till you'll get a list of type MX
. Simply pick one address out of this list (maybe the first, maybe the one with the lost value in preference) and use this to establish your smtp connection.
您将获得一个负责任的DNS服务器列表。只需从列表中选择一个(例如192.26.92.30)并再次向该服务器发送相同的查询。重新运行此序列,直到您获得MX类型列表。只需从此列表中选择一个地址(可能是第一个,也许是优先丢失的值)并使用它来建立您的smtp连接。
That's the way how every mail server does its work. Now it is up to you to implement that into your application. ;-)
这就是每个邮件服务器如何工作的方式。现在,您可以将它实现到您的应用程序中。 ;-)