简体   繁体   English

如何从用户的电子邮件地址检索SMTP服务器?

[英]How can I retrieve the SMTP server from the users email address?

I'm programming a email sending program in C# The user gives his email address, and also the email address from the reciever. 我正在用C#编写电子邮件发送程序,用户提供了他的电子邮件地址,也提供了收件人的电子邮件地址。

How can I retrieve the SMTP server from the users email address? 如何从用户的电子邮件地址检索SMTP服务器?

For example: The user gives "user7712279@gmail.com". 例如:用户输入“ user7712279@gmail.com”。 And I need to find the SMTP server "smtp.gmail.com". 而且我需要找到SMTP服务器“ smtp.gmail.com”。 But for Yahoo, Hotmail, and other email services, it must work also. 但是对于Yahoo,Hotmail和其他电子邮件服务,它也必须起作用。 How can I do that? 我怎样才能做到这一点?

You cannot retrieve an SMTP server from an email address. 您无法从电子邮件地址检索SMTP服务器。 It could be sent from basically any SMTP server regardless of the email address. 基本上可以从任何 SMTP服务器发送该邮件,而不管其电子邮件地址如何。

Additionally, most SMTP servers require some for of authentication and you would need to have the necessary credentials for all SMTP servers. 此外,大多数SMTP服务器要求进行某些身份验证,您需要具有所有SMTP服务器所需的凭据。

In general, when sending emails from your own application, you would need one SMTP server which you own or pay which you would use to send emails. 通常,从自己的应用程序发送电子邮件时,您将需要一台拥有或付款的SMTP服务器,该服务器将用于发送电子邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM