跳到内容

SMTP URI and logging

v0.4.7

Viktor Szépe · 2015年8月10日 上架

SMTP settings for WordPress and error logging.

正在使用
10+
评分
暂无
累计下载
3,079
最近更新
2015年12月28日
需要 WordPress 4.0+已测试到 4.4.34

贡献者

Using SMTP protocol to transfer emails ensures solid operations.
It is very easy to set up SMTP. You can find the settings for this plugin at the bottom of WordPress admin menu Options / General.

You should get your SMTP settings from your ISP, hosting provider, webmaster, email provider etc.

Using every option SMTP URI formally looks like this:

smtpTLS://USERNAME:PASSWORD@HOST:PORT

Thus encryption type and :// and user name and : and password and @ and mail server name and : and port number.
All except encryption type and mail server (host name) are optional.

SMTP encryption types are as follows:

  • For encrypted connection (STARTTLS on submission port) start your SMTP URI with smtpTLS:// – the default port is 587.
  • For fully SSL encrypted connection (SMTPS) start it with smtps:// – the default port is 465.
  • For unencrypted connection (plain SMTP) start it with smtp:// – the default port is 25. This is not recommended for non-local servers.

WARNING! Use URL-encoded strings.

You can find the settings for this plugin at the bottom of WordPress admin Options / General.

You may define your SMTP URI also in wp-config.php:

define( 'SMTP_URI', 'smtpTLS://USERNAME:PASSWORD@HOST:PORT' );

To set From: name and From: address use
WP Mail From II plugin.

SMTP error logging

SMTP communication errors are logged in PHP error.log and – if
Sucuri Scanner
plugin is available – are sent to Sucuri and can be viewed in its Alert Logs panel.

Adding automatic Bcc: address

An automatic Bcc: address can be set by adding path to SMTP URI: /admin_email.

SMTP debugging

Add query string to SMTP URI: ?debug.

Debug level can be set by adding a value: ?debug=4, possible values: 0,1,2,4

TODO

  • Option to skip newsletters: ALO Newsletter, Newsletter, Mailpoet.
  • Video on installing and setting up this plugin.
  • Remove smtp_uri option on uninstallation (I hope you won’t uninstall it)

Usage examples

Unauthenticated local SMTP server on port 25

smtp://localhost

Unauthenticated local SMTP server on submission port

smtpTLS://localhost

Authenticated connection to localhost on port 25

smtp://john.doe:Secretpwd1@localhost

“@” sign in the username, a Gmail example

smtps://your.address%40gmail.com:Gmail_password@smtp.gmail.com

Sendgrid example

smtpTLS://CREDENTIAL-USERNAME:PASSWORD@smtp.sendgrid.net

Mandrill example

smtpTLS://REGISTERED%40EMAIL:API-KEY@smtp.mandrillapp.com

Unauthenticated SMTP server on a custom port

smtpTLS://mail.server.net:2525

Development goes on on GitHub.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums