配置SMTP服务器发送邮件。

时间:2021-11-05 14:32:22

I have deployed a website (ASP.Net/C#) on my windows server 2012 R2 (it's a VPS and I installed IIS and SMTP), and everything works fine except one thing: I CANNOT send mail through my website!

我在我的windows server 2012 R2上部署了一个网站(asp.net/c#)(它是一个VPS,我安装了IIS和SMTP),除了一件事:我不能通过我的网站发送邮件!

I searched and tried everything but it still doesn't work! When I was debugging my application on local, it worked fine. Now I know I have to change my settings to send mail but I don't know what I should indicate

我找遍了所有的东西,但还是没有用!当我在本地调试我的应用程序时,它运行得很好。现在我知道我必须更改我的设置来发送邮件,但是我不知道我应该指出什么。

I'm sending my emails from a mail address that use pop3 server "relay.skynet.be" (this is the server I used when I was debugging and it worked) but when I do it on the website I got an error... So I changed it to the name of the server where my VPS is hosted (OVH) and it still doesn't work... I also changed the different credentials (in my code or in the SMTP in IIS) but the result is the same...

我从一个使用pop3服务器的邮件地址发送我的电子邮件。(这是我调试时使用的服务器),但是当我在网站上做的时候,我有一个错误……所以我把它改成了我的VPS托管的服务器的名称(OVH),它仍然不起作用……我还更改了不同的凭据(在我的代码中或在IIS中的SMTP中),但结果是相同的……

So I'm asking these questions:

所以我问这些问题:

  • In my code (C#), what should I indicate?? Which server should I indicate? And which credentials?
  • 在我的代码(c#)中,我应该指出什么?我应该指出哪个服务器?哪些证书?
  • On Windows Server, in the SMTP settings in IIS, what should I choose? Should I indicate the e-mail address with which I send my emails? Do I have to check the "Use localhost" for the SMTP server to use or indicate the server of my mail address (relay.skynet.be) or the one from OVH? And for the credentials, what do I have to check? "Not required", "Windows" or "Specify Credentials" (with my mail address credentials?)
  • 在Windows服务器上,在IIS的SMTP设置中,我应该选择什么?我是否应该指出我发送邮件的电子邮件地址?我是否需要检查SMTP服务器的“使用localhost”来使用或指示我的邮件地址(relay.skynet.be)或来自OVH的服务器?对于凭证,我要检查什么?“不需要”、“Windows”或“指定凭证”(用我的邮件地址凭证?)

1 个解决方案

#1


0  

I have a strong feeling that you are simply missing the infrastructure - specifically, you are missing an SMTP server. SMTP server is responsible for delivering (or forwarding) your email.

我有一种强烈的感觉,您只是缺少基础设施——特别是,您缺少一个SMTP服务器。SMTP服务器负责发送(或转发)您的电子邮件。

Neither POP3 nor IMAP protocols are used for sending emails.

POP3和IMAP协议都不用于发送电子邮件。

If this is the case, I suggest you try using hotmail or gmail mail account. You can find the settings for both here, respectively:

如果是这样,我建议您尝试使用hotmail或gmail邮件帐户。您可以分别在这里找到它们的设置:

http://www.serversmtp.com/en/smtp-hotmail http://www.serversmtp.com/en/smtp-gmail-configuration

http://www.serversmtp.com/en/smtp-hotmail http://www.serversmtp.com/en/smtp-gmail-configuration

Hope this helps.

希望这个有帮助。

#1


0  

I have a strong feeling that you are simply missing the infrastructure - specifically, you are missing an SMTP server. SMTP server is responsible for delivering (or forwarding) your email.

我有一种强烈的感觉,您只是缺少基础设施——特别是,您缺少一个SMTP服务器。SMTP服务器负责发送(或转发)您的电子邮件。

Neither POP3 nor IMAP protocols are used for sending emails.

POP3和IMAP协议都不用于发送电子邮件。

If this is the case, I suggest you try using hotmail or gmail mail account. You can find the settings for both here, respectively:

如果是这样,我建议您尝试使用hotmail或gmail邮件帐户。您可以分别在这里找到它们的设置:

http://www.serversmtp.com/en/smtp-hotmail http://www.serversmtp.com/en/smtp-gmail-configuration

http://www.serversmtp.com/en/smtp-hotmail http://www.serversmtp.com/en/smtp-gmail-configuration

Hope this helps.

希望这个有帮助。