Swift SMTP Mailer插件
如果你的163信箱或者hotmail信箱不能收到从WordPress MU发出的email的话,很有可能是你的邮件当作垃圾邮件被屏蔽了。解决的办法就是利用外部的SMTP服务器发出邮件。
Swift SMTP插件通过使用Swift Mailer
函数库来连接外部的SMTP服务器。为什么不用最有名的PHPMailer函数库呢?看一下这里的比较就知道:http://www.swiftmailer.org/phpmailer/
如果你要使用Gmail的SMTP服务器,那Swift Mailer是唯一的选择。
这次的最初发布文件是基于ShiftThis
制作的Swift SMTP插件
. 通过简单修改以后,可以很好的支持WPMU(在1.0和1.1.1版本测试通过). 我们还会在近期加以改进。
下载地址: WPMUdev.org
安装使用:
- 解压zip压缩包;
- 修改shiftthis-smtp.php文件内的SMTP服务器设置选项 (具体请见下面的例子);
- 上传文件到 /wp-content/mu-plugins/ 目录.
SMTP 服务器设置选项
在shiftthis-smtp.php文件内, 修改以下几个参数:
- $st_smtp_config[’server’]
设置为外部 SMTP 服务器地址 (例如: smtp.yourhost.com). - $st_smtp_config[’username’]
SMTP登陆用户名. - $st_smtp_config[’password’]
SMTP登陆用户密码. - $st_smtp_config[’ssl’]
按照SMTP服务器,设置加密选项,如果是TLS 或者 SSL 加密的SMTP服务器,设置为 ‘tls’ 或 ’ssl’, 否则设置为 ‘No’. - $st_smtp_config[’port’]
端口设置,一般SMTP端口为25, 如果是TLS或者SSL服务器,使用465端口, 也可以使用其他的非默认端口设置.
设置例子:
- 普通25端口 SMTP 服务器设置
- Gmail SMTP服务器设置:
$st_smtp_config['server'] = “smtp.yourserver.com”;
$st_smtp_config['username'] = “noreply@yourserver.com”;
$st_smtp_config['password'] = “whatever”;
$st_smtp_config['ssl'] = “No”;
$st_smtp_config['port'] = 25;
$st_smtp_config['server'] = “smtp.gmail.com”;
$st_smtp_config['username'] = “username@gmail.com”;
$st_smtp_config['password'] = “whatever”;
$st_smtp_config['ssl'] = “tls”;
$st_smtp_config['port'] = 465;


