nodejs创建服务器_使用NodeJS创建SMTP服务器

nodejs创建服务器

In this article, I will show you how simple it is to create an SMTP server using NodeJS and be up and running in a few minutes. You can then send emails to your node application, either as a method of remote control or for 1001 other reasons.

在本文中,我将向您展示使用NodeJS创建SMTP服务器并在几分钟内启动并运行它是多么简单。 然后,您可以将电子邮件作为远程控制方法或出于其他1001个原因而发送到节点应用程序。

An SMTP receives emails from other email servers or email clients. If you want an application to process emails in realtime, then your own SMTP server is the way to go. Writing your own server provides some added benefits, like being able to use your own domain name with unlimited email addresses at no extra cost.

SMTP接收来自其他电子邮件服务器或电子邮件客户端的电子邮件。 如果您希望应用程序实时处理电子邮件,那么您便可以使用自己的SMTP服务器。 编写自己的服务器具有一些额外的好处,例如能够免费使用具有无限电子邮件地址的自己的域名。

There is a bit more work to get it up and running, but I promise, it’s not that much.

要启动并运行还需要做更多的工作,但是我保证,这还不算什么。

您将需要什么。 (What you're going to need.)

  • Your own domain name with the ability to edit DNS records.

    您自己的域名,可以编辑DNS记录。
  • NodeJS

    节点JS
  • A fixed IP Address

    固定IP地址
  • If you're on a home network you will need to be able to set up port forward rules on your Internet Router.

    如果您在家庭网络中,则将需要能够在Internet路由器上设置端口转发规则。

DNS设置 (DNS setup)

In order for a domain to receive emails, it needs to know about the mail server that will handle incoming email.

为了使域接收电子邮件,它需要了解将处理传入电子邮件的邮件服务器。

I already have a domain hackmail.net which I will use as an example throughout this tutorial.

我已经有一个域名hackmail.net ,在本教程中将作为示例。

Here is how you need to configure your domain records. I use 123-reg.co.uk for domain registration. They provide their own guide on mail server setup. Your registrar may have a similar guide.

这是您需要配置域记录的方式。 我使用123-reg.co.uk进行域名注册。 他们提供有关邮件服务器设置指南 。 您的注册商可能有类似的指南。

第1步 (Step 1)

Delete any existing MX records on your domain.

删除您域中所有现有的MX记录。

第2步 (Step 2)

Add a new A record that points to your internet router IP Address.

添加一个新的A记录, A记录指向您的Internet路由器IP地址。

Hostname: mail
Type: A
Desination IP Address: <Your routers Public IP Address>

第三步 (Step 3)

Create a new MX record that points to the fully qualifi

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值