PHP code example of markguinn / silverstripe-email-helpers
1. Go to this page and download the library: Download markguinn/silverstripe-email-helpers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
markguinn / silverstripe-email-helpers example snippets
$encryption = 'tls'; // use tls
$charset = 'UTF-8'; // use specified charset if set
// you can specify a port as in 'yourserver.com:587'
$mailer = new SmtpMailer('yourserver.com', 'username', 'password', $encryption, $charset);
Email::set_mailer($mailer); // or Injector::inst()->registerService($mailer, 'Mailer');
Email::set_mailer( new SmtpMailer() );
$encryption = 'ssl'; // use ssl
$charset = 'UTF-8';
$externalcssfile = 'themes/{yourtheme}/css/externalcssfile.css'; // specify the path to your css file
$SMTPDebug = 2; // Levels 0-4 available
$logfailedemail = true; // Log a notice with PHPMailer's error information
$mailer = new EmogrifiedSmtpMailer('yourserver.com', 'username', 'password', $encryption, $charset, $externalcssfile, $SMTPDebug, $logfailedemail);
Email::set_mailer($mailer); // or Injector::inst()->registerService($mailer, 'Mailer');
Email::set_mailer( new EmogrifiedSmtpMailer() );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.