使用smtp服务器发送邮件

Are you having trouble receiving or sending emails from your WordPress site? One solution for that is to use third party email services such as Mailgun. However, these services will cost you extra money. In this article, we will show you how to use a SMTP server to send WordPress emails.

您是否无法从WordPress网站接收或发送电子邮件? 一种解决方案是使用第三方电子邮件服务,例如Mailgun。 但是,这些服务将花费您额外的钱。 在本文中,我们将向您展示如何使用SMTP服务器发送WordPress电子邮件。

WordPress电子邮件的问题 (The Problem with WordPress Emails)

WordPress uses mail function in PHP to send emails. Many shared hosting providers do not have this function configured properly, or they have disabled it entirely to avoid abuse. In either case, this causes your WordPress emails to not be delivered.

WordPress在PHP中使用邮件功能来发送电子邮件。 许多共享主机提供商未正确配置此功能,或者已完全禁用此功能以避免滥用。 无论哪种情况,这都会导致您的WordPress电子邮件无法发送。

The alternative solution is to use a third party email service to send out your emails. You can use services like Mailgun, Google Apps for work, or Sendgrid.

另一种解决方案是使用第三方电子邮件服务发送您的电子邮件。 您可以使用Mailgun,Google Apps for Work或Sendgrid等服务。

You will have to pay for your account, and the cost will vary depending on how many users/accounts you add or the number of emails you send. See our tutorial on how to fix WordPress not sending email issue.

您将需要为您的帐户付款,费用将根据您添加的用户/帐户数量或发送的电子邮件数量而有所不同。 请参阅我们的教程,了解如何解决WordPress不发送电子邮件的问题 。

What if we told you that there is another option, and most likely you are already paying for it?

如果我们告诉您还有另一种选择,并且很可能您已经为此付费了,该怎么办?

影片教学 (Video Tutorial)

演示地址

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

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

通过主机使用电子邮件帐户 (Using Email Accounts by Your Host)

Most WordPress hosting providers offer email services for each domain you host with them. This means you can create email accounts with your own domain name like yourname@yoursite.com.

大多数WordPress托管提供商都为您托管的每个域提供电子邮件服务。 这意味着您可以使用自己的域名(例如yourname@yoursite.com创建电子邮件帐户。

First you will need to create an email account. For the sake of this example, we will show you how to create an email account in cPanel. Your hosting service provider may use some other account management system, but the basic process is the same on most hosting services.

首先,您需要创建一个电子邮件帐户。 为了这个示例,我们将向您展示如何在cPanel中创建电子邮件帐户。 您的托管服务提供商可能会使用其他帐户管理系统,但是大多数托管服务的基本过程是相同的。

Log into your hosting account, and click on email accounts under the mail section.

登录您的托管帐户,然后单击“邮件”部分下的电子邮件帐户。

This will show you a simple form where you need to fill out information required to create your email account.

这将显示一个简单的表单,您需要在其中填写创建电子邮件帐户所需的信息。

Since we will be using this account to send WordPress emails, we recommend that you create an email account like wordpress@example.com. Make sure to replace example.com with your own domain name.

由于我们将使用此帐户发送WordPress电子邮件,因此建议您创建一个电子邮件帐户,如wordpress@example.com 。 确保用您自己的域名替换example.com。

After creating your email account, you are now ready to use it in WordPress. But before you do that, you will need the following information from your hosting service provider.

创建电子邮件帐户后,您现在就可以在WordPress中使用它了。 但是在您这样做之前,您需要从托管服务提供商处获得以下信息。

  1. SMTP Host for your email address.电子邮件地址的SMTP主机。
  2. SMTP Port for secure login.SMTP端口,用于安全登录。

You can check the support section on your host’s website for this information. Most likely there will be an article providing this information. If you don’t find it, then you should contact the hosting support to request this information.

您可以查看托管人网站上的支持部分以获取此信息。 很可能会有一篇文章提供此信息。 如果找不到,则应联系托管支持以请求此信息。

在WordPress中使用您的品牌电子邮件地址 (Using Your Branded Email Address in WordPress)

You will now need to install and activate the WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

现在,您将需要安装并激活WP Mail SMTP插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to visit Settings » Email to configure the plugin settings.

激活后,您需要访问设置»电子邮件以配置插件设置。

First you need to enter the email address you just created. After that you can add a from name, this will be used as the sender name.

首先,您需要输入刚创建的电子邮件地址。 之后,您可以添加一个发件人名称,它将用作发件人名称。

If you do not add a from name, then the plugin will use the default WordPress.

如果您没有添加“ from”名称,则该插件将使用默认的WordPress。

Next, you need to choose the mailer. Go ahead and click on the ‘Other SMTP’ option to select it.

接下来,您需要选择邮件程序。 继续并单击“其他SMTP”选项以将其选中。

After that, you need to check the box next to ‘Return Path’ option. This option sets the return path to match the sender email address. If you leave it unchecked, bounced messages and non-delivery receipts will be lost.

之后,您需要选中“返回路径”选项旁边的框。 此选项设置返回路径以匹配发件人电子邮件地址。 如果不选中它,退回邮件和未送达回执将丢失。

Next, you need to set up SMTP options.

接下来,您需要设置SMTP选项。

First you need to enter your SMTP host and port. You can obtain this information from your hosting provider. Typically, SMTP host is mail.yourdomain.com (replace yourdomain.com with your own domain name). For SMTP Port 465 is commonly used.

首先,您需要输入SMTP主机和端口。 您可以从托管服务提供商处获取此信息。 通常,SMTP主机是mail.yourdomain.com(用您自己的域名替换yourdomain.com)。 对于SMTP,通常使用端口465。

Next, you need to choose encryption. Most WordPress hosting companies support SSL and TLS. We recommend using TLS option when available.

接下来,您需要选择加密。 大多数WordPress托管公司都支持SSL和TLS。 我们建议使用TLS选项(如果可用)。

After that turn on the authentication toggle and provide your SMTP username and password. Normally, your email address is also your SMTP username.

之后,打开身份验证切换并提供您的SMTP用户名和密码。 通常,您的电子邮件地址也是SMTP用户名。

Your password is stored as plain text, which is not safe. Don’t worry, we will show you how to make more secure later in this article.

您的密码以纯文本格式存储,因此不安全。 不用担心,我们将在本文后面向您展示如何提高安全性。

Don’t forget to click on the save settings button to store your changes.

不要忘记单击“保存设置”按钮来存储您的更改。

测试您的SMTP设置 (Testing Your SMTP Settings)

Now that you have set up WP Mail SMTP to send emails, let’s test if everything is working fine. On the plugin’s settings page, click on the ‘Email Test’ tab.

现在,您已经设置了WP Mail SMTP发送电子邮件,让我们测试一下一切是否正常。 在插件的设置页面上,单击“电子邮件测试”选项卡。

You need to provide an email address where you would like to receive test email. This could be any valid email address that you can access. After that click on the Send Email button to continue.

您需要提供一个电子邮件地址,您想在其中接收测试电子邮件。 这可以是您可以访问的任何有效电子邮件地址。 之后,单击发送电子邮件按钮继续。

WP Mail SMTP will now send an email message using the SMTP settings you entered earlier. You will see a success message when email is sent successfully.

WP Mail SMTP现在将使用您先前输入的SMTP设置发送电子邮件。 成功发送电子邮件后,您将看到一条成功消息。

保护您的电子邮件密码 (Securing Your Email Password)

You may need to enter your email account password in WP MAIL SMTP settings. This password is normally stored as plain text which is unsafe.

您可能需要在WP MAIL SMTP设置中输入您的电子邮件帐户密码。 该密码通常以纯文本格式存储,这是不安全的。

However, the plugin also provides you an option to make it more secure. To do that, you will need to add some code to your wp-config.php file. If you haven’t done this before, then please see our guide on how to edit wp-config.php file in WordPress.

但是,该插件还为您提供了使其更安全的选项。 为此,您将需要在wp-config.php文件中添加一些代码。 如果您之前没有做过,请参阅我们的指南, 了解如何在WordPress中编辑wp-config.php文件。

First you will need to connect to your website using a FTP client or File Manager app in cPanel. Once connected, you will find your wp-config.php file in the root folder of your website.

首先,您需要使用cPanel中的FTP客户端或文件管理器应用程序连接到您的网站。 连接后,您将在网站的根文件夹中找到wp-config.php文件。

You can edit this file using any plain text editor like Notepad or TextEdit.

您可以使用任何纯文本编辑器(如记事本或TextEdit)来编辑此文件。

Locate the line that says ‘That’s all, stop editing! Happy blogging’ and add the following code just before it.

找到说“就这样,停止编辑! 祝您博客愉快”,并在其之前添加以下代码。


define( 'WPMS_ON', true );
define( 'WPMS_SMTP_PASS', 'your_password' );

Don’t forget to replace ‘your_password’ with your actual SMTP password. After that, save and upload your wp-config.php file back to server.

不要忘记用您的实际SMTP密码替换“ your_password”。 之后,保存您的wp-config.php文件并将其上传回服务器。

You can now visit your WordPress admin area and go to Settings » WP Mail SMTP page. Scroll down to the SMTP options section and you will see password field is now disabled.

现在,您可以访问WordPress管理区域,然后转到“设置”»“ WP Mail SMTP”页面。 向下滚动到“ SMTP选项”部分,您将看到密码字段现已禁用。

对WordPress电子邮件问题进行故障排除 (Troubleshooting WordPress Email Issues)

The most common reason for errors in sending emails using SMTP is incorrect SMTP host or port. Make sure that you are entering the correct host and port settings provided by your hosting provider.

使用SMTP发送电子邮件时出错的最常见原因是不正确的SMTP主机或端口。 确保您输入的是主机提供商提供的正确的主机和端口设置。

Make sure that you select the correct encryption method. Usually SSL works on most environments, but we recommend that you check with your web host if your emails are not getting delivered.

确保选择正确的加密方法。 SSL通常可在大多数环境中使用,但是如果您的电子邮件没有发送,我们建议您与Web主机联系。

将Web主机的邮件服务器用于WordPress电子邮件的利弊 (Pros and Cons of Using Your Web Host’s Mail Servers for WordPress Emails)

First and the most obvious advantage is that you can use your own branded email address for outgoing emails in WordPress.

首先也是最明显的优势是,您可以将自己的品牌电子邮件地址用于WordPress中的外发电子邮件。

Another advantage is that you have already paid for this service when signing up for your hosting account. You will not need to pay any extra money for sending and recieving emails.

另一个好处是,您在注册主机帐户时已经为该服务付费。 您无需为发送和接收电子邮件支付任何额外的费用。

However, some WordPress hosting providers enforce limitations on outgoing emails. This is why we don’t recommend using WordPress to send newsletter emails.

但是,某些WordPress托管服务提供商对外发电子邮件实施限制。 这就是为什么我们不建议使用WordPress发送时事通讯电子邮件的原因 。

Another common problem with shared hosting providers is that their mail servers can be quite unreliable at times. If you notice delays in email delivery, then you should consider using third party email services like Google Apps for Work, Mailgun, or SendGrid.

共享主机提供商的另一个常见问题是,有时它们的邮件服务器可能非常不可靠。 如果您发现电子邮件发送延迟,则应考虑使用第三方电子邮件服务,例如Google Apps for Work ,Mailgun或SendGrid。

We hope this article helped you learn how to use SMTP server to send WordPress emails. You may also want to see our list of the must have WordPress plugins for businesses.

我们希望本文能帮助您学习如何使用SMTP服务器发送WordPress电子邮件。 您可能还希望查看我们的必须具有适用于企业的WordPress插件的列表。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-use-smtp-server-to-send-wordpress-emails/

使用smtp服务器发送邮件

使用smtp服务器发送邮件_如何使用SMTP服务器发送WordPress电子邮件相关推荐

  1. smtp在线发送邮件_基于树莓派3B,利用爬虫、SMTP和发送邮件amp;amp;(爬取墨迹天气预报信息)...

    转载请注明: 利用爬虫.SMTP和树莓派3B发送邮件&续集&(爬取墨迹天气预报信息) - 永怀一颗学徒的心 - 博客园​www.cnblogs.com ZXPXBB:基于树莓派3B,利 ...

  2. java服务器发送邮件_服务器通过模板发送邮件java代码

    //文件读取类 public class TemplateFileRead { private String content= null; public TemplateFileRead() { } ...

  3. 云服务ftp服务器搭建_在阿里云服务器搭建FTP服务器,在本地电脑连接并操作

    首先你需要有一个阿里云的ECS服务器 并且开通了公网宽带(话说也不贵,开来玩玩还是可以的,第一次买会比较便宜,第二次买1M的宽带两天是九毛多吧~) 开通了宽带之后,ECS服务器就可以上网了 如果嫌弃阿 ...

  4. teamspeak3服务器搭建_搭建TeamSpeak语音服务器

    1.下载 用文件传输工具传输到服务器上(/root目录下) 2.安装 更新系统 yum update 开放端口 systemctl start firewalld firewall-cmd --zon ...

  5. python做服务器监控_使用python进行服务器的监控

    在Linux服务器中,一切皆为文件,就是说,服务器运行的个中信息,其实是可以从某些文件中查询得到的:百度后,你会知道,在Linux系统中,有一个/proc的虚拟文件系统: Linux 系统为管理员提供 ...

  6. PHP通过SMTP实现发送邮件_包括附件

    require("class.phpmailer.php"); //这个是一个smtp的php文档,网上可以下载得到 $mail = new PHPMailer(); //建立邮件 ...

  7. windows云服务器价格_免费windows云服务器

    {"moduleinfo":{"card_count":[{"count_phone":1,"count":1}],&q ...

  8. 无法修改服务器名称_经典怀旧服服务器第六期免费角色转移服务10月18日7:00开放...

    我们预计于10月18日早上7:00起,在指定的<魔兽世界>经典怀旧服服务器开启第六期免费角色转移服务,你可以借此将角色从人口较多.排队时间较长的服务器转移出来. 在免费角色转移服务开放初期 ...

  9. mysql 服务器优化_如何对MySQL服务器进行调优

    如今,社会讲求的就是快速,什么事都要有效率,当然服务器也是要有效率.开发人员不断地开发和部署使用LAMP(?.Apache.MySQL 和 PHP/Perl)架构的应用程序.但是,服务器管理员常常对应 ...

  10. x3850x5服务器内存_联想3850 X5服务器添加内存之后红屏

    近期一个虚拟化项目,使用了2台联想3850 X6.一台3850 X5,其中2台3850 X6配置了128GB内存,3850 X5配置了16GB内存.其中2台3850 X6组成一个HA,X3850 X5 ...

最新文章

  1. 别的设计师比你又快又好,是因为你不知道他们在用介个!
  2. portainer图形化监控
  3. TorgoiseGit配置ssh密钥
  4. 给数组里面的对象添加一个新的数据
  5. ui-grid下拉过滤
  6. mysql无序id怎么优化limit_MYSQL分页limit速度太慢优化方法
  7. linux mysql 共享存储空间_Linux UDEV和为MySQL InnoDB共享表空间配置裸设备
  8. Anchor-free新思路,统一目标检测、实例分割、姿态估计三种任务
  9. 测试用例的八大设计方法
  10. VS2017 无法使用XXX附加到应用程序
  11. 深入linux网络编程(四):使用asio搭建商用服务器
  12. React 18 新特性-入门教程
  13. 双路服务器单路运行,什么叫双路服务器?与PC机、单路机有什么区别?
  14. 华为手机非华为电脑NFC一碰传使用
  15. Python之爬取58同城在售楼盘房源信息
  16. 工商银行网银U盾在win7 64位操作系统无法使用的问题
  17. 《我是谁:没有绝对安全的系统》观影感受
  18. EBS中如何实现简单的日记账导入
  19. luogu P3642 [APIO2016]烟火表演
  20. Android运行项目时提示:No signature of method: build_*.android() is applicable for argument types

热门文章

  1. Android应用市场应用转让申请流程
  2. linux mbr转gpt分区,免重装!迄今为止最详细的MBR转GPT分区攻略
  3. A,B,C,D,E五个人在某天夜里去捕鱼
  4. [蓝桥杯Python]:跑步训练----小蓝每天都锻炼身体。正常情况下,小蓝每天跑1千米。如果某天是周一或者月初(1日),为了激励自己,小蓝要跑2千米。如果同时是周一-或月初,小蓝也是跑2千米。小蓝
  5. 1013: 【顺序结构】数字各位分割
  6. EXCEL 批量插入指标批注
  7. 加拿大教授 武 计算机,加拿大卡尔加里大学Yingxu Wang教授访问计算机学院
  8. 三维空间内任意三点坐标求圆心、半径
  9. 集群机器搭建多节点MPI运行环境
  10. PyQt5的Label鼠标的划过和单击