WordPress邮箱SMTP配置最全指南

本文分享国外主流邮箱WordPress配置SMTP的方法,图文结合,详尽至极,是不可多得的优质文章。

如何配置邮箱的SMTP?

Once you’ve selected Other SMTP as your mailer, a new section will appear with additional SMTP settings for you to configure.

  • SMTP Host: The outgoing server listed in your email provider’s SMTP settings.
  • Encryption: The type of encryption used for the SMTP connection (TLS, SSL, or none).
  • SMTP Port: The port your provider uses for SMTP connections.
  • Authentication: Turns authentication on or off. Most providers require it to be on.
  • SMTP Username: Your email address.
  • SMTP Password: You’ll need to generate an app password for your account, as detailed later in this tutorial.

WordPress邮箱SMTP配置最全指南

Each email provider requires slightly different SMTP configurations. We’ve compiled a list of SMTP configurations for popular email providers below if you’re not sure what to enter for these settings.

以下是最受欢迎的电子邮件提供商所需的 SMTP 设置:

SendLayer Settings

SMTP Host: smtp.sendlayer.net
Encryption: TLS
SMTP Port:  587
Authentication: On
Username: Generated when you authorize your domain
Password: Generated when you authorize your domain

Note: SendLayer generates credentials for your site automatically when you authorize your domain. Check out SendLayer’s guide to managing SMTP credentials for more information.

Gmail or Google Workspace SMTP Settings

Note: Support for using Google less secure apps will be discontinued on May 30, 2022 for some accounts. If you are currently using this feature, consider switching to an app password to prevent any disruption in email delivery.

SMTP Host: smtp.gmail.com
Encryption: TLS
SMTP Port: 587 (or 465 using SSL encryption)
Authentication: On
Username: Your Gmail account email address (e.g., pattie@gmail.com)
Password: You will need to generate an app password in Google

Note: We recommend using our built-in Gmail integration instead of the less secure Other SMTP mailer.

Hotmail or Live SMTP Settings

SMTP Host: smtp.office365.com
Encryption: TLS
SMTP Port: 587
Authentication: On
Username: Your Hotmail account email (e.g., pattie@hotmail.com)
Password: You will need to generate an app password for your account

Yahoo Mail SMTP Settings

SMTP Host: smtp.mail.yahoo.com
Encryption: SSL
SMTP Port: 465
Authentication: On
Username: Your Yahoo Mail account email (e.g., pattie@yahoo.com)
Password: You will need to generate an app password for your account

Yahoo Business (Verizon Small Business Essentials) SMTP Settings

SMTP Host: smtp.bizmail.yahoo.com
Encryption: SSL
SMTP Port: 465
Authentication: On
Username: Your Yahoo Business email address
Password: You will need to generate an app password for your account

AOL SMTP Settings

SMTP Host: smtp.aol.com
Encryption: TLS
SMTP Port: 587
Authentication: On
Username: Your AOL screen name
Password: You will need to generate an app password for your account

Zoho Mail SMTP Settings

Zoho offers two types of email addresses: free accounts (i.e., pattie@zoho.com) and domain-based accounts (i.e., pattie@yourdomain.com). Each type of email requires different SMTP settings. We’ve shared both sets below.

Note: We recommend using the built-in Zoho Mail option instead of connecting Zoho through the Other SMTP mailer.

Emails @zoho.com

Host: smtp.zoho.com
Port: 587 (or 465 using SSL encryption)
Username: Your Zoho Mail account email (e.g. pattie@zoho.com)
Password: You will need to generate an app password for your account
Encryption: TLS

Emails @yourdomain.com

Host: smtppro.zoho.com
Port: 587 (or 465 using SSL encryption)
Username: Your domain-based email (e.g. pattie@yourdomain.com)
Password: You will need to generate an app password for your account
Encryption: TLS

Once you’ve entered these details, be sure to click the Save Settings button at the bottom of the screen.

WordPress邮箱SMTP配置最全指南

Generating an App Password

To use SMTP on your WordPress site, you’ll most likely need to generate an app password in your email account. Below, we’ll show you how to do this for Gmail, Yahoo, AOL, Hotmail, and Live.

Generating an App Password in Gmail

Note: Before you can generate an app password in Gmail, you’ll need to turn on Google’s 2-Step Verification.

To create an app password in Gmail, log in to your Gmail or Google Workspace account.

Then, go to App passwords in your security settings. On this page, click on the Select app dropdown.

WordPress邮箱SMTP配置最全指南

Next, select the Other (Custom name) option from the dropdown menu.

WordPress邮箱SMTP配置最全指南

Then, enter WP Mail SMTP in the field provided and click the blue GENERATE button.

WordPress邮箱SMTP配置最全指南

This will generate an app password that you can use for your WP Mail SMTP setup.

WordPress邮箱SMTP配置最全指南

You’ll want to copy this password, then return to your WP Mail SMTP settings in your WordPress dashboard. From here, paste the password into the SMTP Password field and save your settings.

WordPress邮箱SMTP配置最全指南

Note: Sometimes Gmail may automatically block the sign-in used by SMTP for security reasons, even when using an app password. When this happens, an email will be sent to your recovery email address with a sign-in attempt warning (see below).

To remove this block, you’ll need to click the Check Activity button in the email (or visit your account’s Notifications page) and follow the instructions provided to let Google know this was a legitimate login attempt.

WordPress邮箱SMTP配置最全指南

Generating an App Password in Yahoo

Note: For Yahoo Business (Verizon Small Business Essentials), please see the official documentation on managing app passwords for steps on finding the proper settings for generating your app password. Then you can follow the rest of the steps below.

First, log in to your Yahoo account. Then open your account’s security settings.

In your account’s settings, you’ll need to generate a special password for your WP Mail SMTP integration. To do so, click on Generate app password.

WordPress邮箱SMTP配置最全指南

This will open up an overlay, where you’ll need to select the app you’ll be granting permission to. From the dropdown, select the Other option and enter WP Mail SMTP in the field provided. Then click the Generate button.

WordPress邮箱SMTP配置最全指南

This will generate a one-time password that you can use with WP Mail SMTP.

WordPress邮箱SMTP配置最全指南

Copy this password, then go back to your WP Mail SMTP settings in your WordPress dashboard. Paste the password into the SMTP Password field and save your settings.

WordPress邮箱SMTP配置最全指南

Generating an App Password in AOL

To generate an app password in AOL, log in to your account. Then open your security settings.

You’ll need to generate a special password for your site’s WP Mail SMTP integration in your account’s settings. To do so, click on Generate app password.

WordPress邮箱SMTP配置最全指南

This will open up an overlay, where you’ll need to select the app you’ll be granting permission to. From the dropdown, choose the Other option and enter WP Mail SMTP in the field provided. Then click the Generate button.

WordPress邮箱SMTP配置最全指南

This will generate a one-time password that you can use with WP Mail SMTP.

WordPress邮箱SMTP配置最全指南

Copy the password, then return to your WP Mail SMTP settings in your WordPress dashboard. Paste the password into the SMTP Password field and save your settings.

WordPress邮箱SMTP配置最全指南

Generating an App Password in Outlook

To create an app password in Outlook (including Live and Hotmail accounts), you’ll first need to log in to your account. Then open your account’s security settings.

From here, select the Advanced security options to open up additional security settings.

WordPress邮箱SMTP配置最全指南

Next, you’ll need to activate 2-Factor Authentication (2FA) for your account, if you haven’t already.

Once you’ve enabled 2FA for your account, you’ll return to the Security page, where you’ll need to generate an app password to use with WP Mail SMTP.

To generate your app password, scroll to the App passwords section and click on Create a new app password.

WordPress邮箱SMTP配置最全指南

This will generate a random password that you can use for your account.

WordPress邮箱SMTP配置最全指南

Copy the password, then go back to your WordPress dashboard and WP Mail SMTP settings. Paste the password into the SMTP Password field and save your changes.

WordPress邮箱SMTP配置最全指南

Generating an App Password in Zoho

To generate an app password for Zoho, you’ll first need to log in to your account.

Once you’re logged in, head to your account’s security settings.

From here, scroll to the Application-Specific Passwords section and click the Generate New Password button.

WordPress邮箱SMTP配置最全指南

In the field that pops up, enter WP Mail SMTP and click the Generate button.

WordPress邮箱SMTP配置最全指南

Next, copy the password that Zoho has generated for you.

WordPress邮箱SMTP配置最全指南

Then, head over to your WP Mail SMTP settings. Be sure to paste this password into the SMTP Password field and save your settings.

WordPress邮箱SMTP配置最全指南

Sending a Test Email

Now that all of your SMTP settings are in place, the next step is to make sure everything is working correctly. To do so, go to WP Mail SMTP » Tools and click on the Email Test tab.

WordPress邮箱SMTP配置最全指南

In the Send To field, you can enter any email address whose inbox you have access to. We recommend leaving the HTML setting ON unless you know you’ll only be sending plain text emails.

After you’ve filled out the required settings, go ahead and click the Send Email button to send your test email.

WordPress邮箱SMTP配置最全指南

Once the test email has been sent, you should see a success message that reads, “Success! Test HTML email was sent successfully! Please check your inbox to make sure it was delivered.”

WordPress邮箱SMTP配置最全指南

If you check the inbox for the email address you entered, you should see the email for this test.

Note: If you’re using a Yahoo email address, it may take 5–10 minutes for emails to arrive in your inbox (including test emails).

WordPress邮箱SMTP配置最全指南

Note: If you have forms that send emails through your site, be sure to also test these out by submitting a couple of test entries. That way, you can be certain that these SMTP settings apply to your form emails as well.

Frequently Asked Questions

Why am I getting the following error?

SMTP Error: Could not authenticate

In the sections below, we’ll go over some of the causes of this issue, and a few courses of action you can take to fix it:

Incorrect SMTP Username and Password

In your WP Mail SMTP settings, double-check that your SMTP Username and SMTP Password are correct.

WordPress邮箱SMTP配置最全指南

Note: The following mailers require you to generate an app-specific password: GmailHotmail or LiveYahooYahoo Business, and AOL. For details on how to generate passwords for each of these apps, please refer to the Generating an App Password section.

Misplaced Constants

If you are using constants to set up WP Mail SMTP, please double-check to be sure you’ve added them in the correct place. Please refer to our guide on securing SMTP settings with constants for more details.

Adding a Custom Filter

The WordPress (PHPMailer) uses these auth types in order:

CRAM-MD5, LOGIN, PLAIN, XOAUTH2

If the receiving SMTP server is not configured correctly, it will fail at the first one.

If you’ve covered the two troubleshooting options above, and you’re still receiving the error, you can try adding the following filter:

add_filter( 'wp_mail_smtp_custom_options', function( $phpmailer ) {
    $phpmailer->AuthType = 'LOGIN';
    return $phpmailer;
} );

Note: For extra guidance, please see WPBeginner’s tutorial on adding custom code.

That’s it! You’ve now configured the Other SMTP mailer on your WordPress site, and your site’s emails should start delivering successfully and reliably.

Next, would you like to keep a record of all the emails sent out from your WordPress site? Be sure to check out our doc on setting up email logging so you can always see what emails have been sent.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

给TA打赏
共{{data.count}}人
人已打赏
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索