如何从Localhost接收WordPress电子邮件

When using WordPress on localhost, you may come across situations where you would need to receive an email generated by WordPress or a plugin. By default, the mail functionality is not enabled on WAMP or MAMP on Mac server stacks. However, you can configure them to use Gmail SMTP server but this would require messing with the configuration files. In this article, we will show you how to receive or send WordPress emails from localhost.

在本地主机上使用WordPress时 ,可能会遇到需要接收WordPress或插件生成的电子邮件的情况。 默认情况下, Mac服务器堆栈上的WAMP或MAMP未启用邮件功能。 但是,您可以将它们配置为使用Gmail SMTP服务器,但这将需要弄乱配置文件。 在本文中,我们将向您展示如何从本地主机接收或发送WordPress电子邮件。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

First thing you need to do is install and activate WP Mail SMTP plugin on the WordPress installation on your local server. After activation, go to Settings » Email to configure the plugin.

您需要做的第一件事是在本地服务器上的WordPress安装上安装并激活WP Mail SMTP插件。 激活后,转到“设置”»“电子邮件”以配置插件。

The first option on this screen is the ‘From Email’, you need to enter your Gmail email address here. The next option is From Name which will be used as the name of the sender in outgoing messages. You can enter ‘WordPress’ here. This will make it easier for you to recognize an email. The third option on the screen is for choosing a mailer. The default php mail function will not work on most local server environments without configuring it. So you need to choose ‘Send all WordPress emails via SMTP’.

此屏幕上的第一个选项是“发件人电子邮件” ,您需要在此处输入您的Gmail电子邮件地址。 下一个选项是发件人名称 ,它将用作传出邮件中发件人的名称。 您可以在此处输入“ WordPress”。 这将使您更容易识别电子邮件。 屏幕上的第三个选项是用于选择邮件程序。 如果没有配置,默认的php邮件功能将无法在大多数本地服务器环境中使用。 因此,您需要选择“通过SMTP发送所有WordPress电子邮件”

Setting up WordPress on Localhost to use Gmail SMTP server

Now you need to configure the plugin to use Gmail’s SMTP server to send mail. In the SMTP server field, enter smtp.gmail.com and for the port field use 587. For the encryption option you need to choose TLS. Lastly, you need to click on Yes next to authentication, you would need to provide your complete Gmail address, e.g. yourusername@gmail.com and your Gmail password.

现在,您需要配置插件以使用Gmail的SMTP服务器发送邮件。 在SMTP服务器字段中,输入smtp.gmail.com ,对于端口字段,请使用587。对于加密选项,您需要选择TLS。 最后,您需要单击身份验证旁边的是,您需要提供完整的Gmail地址,例如yourusername@gmail.com和您的Gmail密码。

Adding Gmail SMTP Server details in WordPress on Localhost

That’s all. You can now click on Save Changes button to store your settings. Once your settings are saved, scroll down to the bottom of the page and try sending a test message. After sending yourself a test message, you can check your inbox to see if you have received the message and everything is working fine.

就这样。 现在,您可以单击“保存更改”按钮来存储您的设置。 保存设置后,向下滚动到页面底部,然后尝试发送测试消息。 向自己发送测试消息后,您可以检查收件箱以查看是否收到了该消息,并且一切正常。

We hope this article helped you receive WordPress emails on localhost. For questions and feedback please leave a comment below or join us on Twitter.

我们希望本文能帮助您在本地主机上接收WordPress电子邮件。 对于问题和反馈,请在下面发表评论或在Twitter上加入我们。

翻译自: https://www.wpbeginner.com/plugins/how-to-receive-wordpress-emails-from-localhost/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值