mediadevils/silverstripe-smtp

此软件包的最新版本(3.1)没有提供许可证信息。

为SilverStripe定制的SMTP邮件发送器

安装次数: 4,375

依赖关系: 0

建议者: 0

安全性: 0

星标: 5

关注者: 5

分支: 26

类型:silverstripe-module

3.1 2013-12-16 01:11 UTC

This package is not auto-updated.

Last update: 2024-09-24 05:10:49 UTC


README

基于http://silverstripe.org/smtpmailer-module/,但由于它过时且在GitHub上不可用,我创建了此分支。

描述

silverstripe-smtp自动发送电子邮件(例如,来自UserForms),而不是使用PHP的内置mail()函数,发送到您的提供商或托管商的SMTP服务器。

silverstripe-smtp用PHPMailer 5.2.1替换了经典的SilverStripe Mailer(使用mail()函数),通过SMTP协议将电子邮件发送到本地或远程SMTP服务器。

何时使用此模块

  • 如果您的提供商禁用了mail()
  • 如果您在发送电子邮件时遇到DNS配置问题,因为某些邮件服务器在域名不匹配时丢弃电子邮件
  • 如果您想从本地Web服务器发送电子邮件,而不需要安装邮件服务器,可以使用外部SMTP服务器
  • 如果您想发送加密的电子邮件(使用SSL或TLS协议)

要求

SilverStripe 2.4+(可能适用于2.3,但仅在2.4上进行了测试)

安装

  1. silverstripe-smtp文件夹提取到您的网站顶层,并将其重命名为smtp
  2. 在不进行任何配置的情况下,该模块将连接到本地主机上的邮件服务器,不进行身份验证
  3. 如果您想在不卸载模块的情况下回退到经典邮件发送器:编辑smtp/_config.php并取消注释set_mailer语句

配置

通过编辑mysite/_config.php来配置模块,并设置以下常量

//Required:
define('SMTPMAILER_SMTP_SERVER_ADDRESS', 'smtp.gmail.com'); //SMTP server address
define('SMTPMAILER_DO_AUTHENTICATE', true); //Turn on SMTP server authentication. Set to false for an anonymous connection
define('SMTPMAILER_USERNAME', 'foo@gmail.com'); //SMTP server username, if SMTPAUTH == true
define('SMTPMAILER_PASSWORD', 'bar'); //SMTP server password, if SMTPAUTH == true

//Optional:
define('SMTPMAILER_CHARSET_ENCODING', 'utf-8'); //Email characters encoding, e.g. : 'utf-8' or 'iso-8859-1'
define('SMTPMAILER_USE_SECURE_CONNECTION', 'ssl'); //SMTP encryption method : Set to '', 'tls', or 'ssl'
define('SMTPMAILER_SMTP_SERVER_PORT', 465); //SMTP server port. Set to 25 if no encryption is used, 465 if ssl or tls is activated
define('SMTPMAILER_DEBUG_MESSAGING_LEVEL', 0); //Print debugging informations. 0 = no debuging, 1 = print errors, 2 = print errors and messages, 4 = print full activity
define('SMTPMAILER_LANGUAGE_OF_MESSAGES', 'de'); //Language for messages. Look into smtp/code/vendor/language/ for available languages

许可证

Copyright (c) 2008 Renaud Merle, 2012 Philipp Krenn
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the authors nor the names of its contributors
      may be used to endorse or promote products derived from this
      software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.