2017 © Pedro Peláez
 

silverstripe-module smtpmailer

SMTPMailer for Silverstripe

image

andrelohmann-silverstripe/smtpmailer

SMTPMailer for Silverstripe

  • Friday, May 13, 2016
  • by andrelohmann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 405 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 11 Versions
  • 4 % Grown

The README.md

Fork of http://www.silverstripe.org/smtpmailer-module/

Requirements

Silverstripe 3.3.x, (*1)

Installation

add the following to your _ss_environment.php, (*2)

// smtpmailer
define('SMTPMAILER', json_encode([
    "charset_encoding" => "utf-8", // E-mails characters encoding, e.g. : 'utf-8' or 'iso-8859-1'
    "debug_level" => "0", // Print debugging informations. 0 = no debuging, 1 = print errors, 2 = print errors and messages, 4 = print full activity
    "debug_stop" => true, // Stop Script on debugging. true = echo and die, false = echo can be catched by ob_start(); $var = ob_get_clean();
    "credentials" => [
        "default" => [
            "server_address" => "smtp.gmail.com", // SMTP server address
            "server_port" => "465", // SMTP server port. Set to 25 if no encryption or tls. Set to 465 if ssl
            "secure_connection" => "ssl", // SMTP encryption method : Set to '' or 'tls' or 'ssl'
            "do_authenticate" => true, // Turn on SMTP server authentication. Set to false for an anonymous connection
            "username" => "__EMAILADDRESS__", // SMTP server username, if do_authenticate == true
            "password" => "__PASSWORD__", // SMTP server password, if do_authenticate == true
            "from" => "__EMAILADDRESS__" // From Address: e.g. "My Name" <my.account@gmail.com>, optional, use when from address needs to be fixed
        ],
        "log" => false // false or array with credentials
    ]
]));

// Error Log Email Address
define('LOG_EMAIL','__EMAIL__'); // logs will be send to this address, if defined

default and log credentials are mendatory. if you want to offer different smtp gateways inside your app, just add them to the credentials array., (*3)

selecting a special credentials set for an email is done by setting the credentials config, (*4)

Config::inst()->update('SmtpMailer', 'credentials', '__CREDENTIALS_SET__'); // "default" by default

Example

Example code for fetching debugging return code and using it inside your application, (*5)

$settings = Config::inst()->get('SmtpMailer', 'settings');
$settings['debug_level'] = 4;
$settings['debug_stop'] = false;
Config::inst()->update('SmtpMailer', 'settings', $settings);

// start collecting the echo messages
ob_start();

// SEND MAIL
$email = new Email();
$email->setTo(__EMAIL__);
$email->setSubject(__SUBJECT__);
$email->setBody(__BODY__);
$success = $email->sendPlain();

// write echo messages into Variable
$echoes = ob_get_clean();

if(!success) die($echoes);

Notice

This repository uses the git flow paradigm. After each release cycle, do not forget to push tags, master and develop to the remote origin, (*6)

git push --tags
git push origin develop
git push origin master

The Versions

13/05 2016

dev-master

9999999-dev

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

13/05 2016

dev-develop

dev-develop

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

13/05 2016

3.1.0

3.1.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

22/04 2016

3.0.2

3.0.2.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

22/04 2016

v3.0.1

3.0.1.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

09/04 2016

3.0.0

3.0.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

19/10 2015

v2.0.1

2.0.1.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

01/09 2015

v2.0.0

2.0.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

03/02 2015

v1.2

1.2.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

09/09 2014

v1.1

1.1.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires

 

15/08 2014

v1.0

1.0.0.0

SMTPMailer for Silverstripe

  Sources   Download

The Requires