Skip to content

Instantly share code, notes, and snippets.

@juizmill
Last active December 24, 2015 03:29

Revisions

  1. juizmill revised this gist Sep 28, 2013. 2 changed files with 28 additions and 0 deletions.
    27 changes: 27 additions & 0 deletions global.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <?php

    /**
    * Global Configuration Override
    *
    * You can use this file for overriding configuration values from modules, etc.
    * You would place values in here that are agnostic to the environment and not
    * sensitive to security.
    *
    * @NOTE: In practice, this file will typically be INCLUDED in your source
    * control, so do not include passwords or other sensitive information in this
    * file.
    */
    return array(
    'mail' => array(
    'name' => 'smtp.gmail.com', #SMTP do servidor de e-mail
    'host' => 'smtp.gmail.com', #No google só repetir o SMTP
    'port' => 465, #Porta do servidor de e-mail
    'connection_class' => 'login', #Diz que será feito uma autenticação para disparar os e-mail
    'connection_config' => array(
    'from' => '[email protected]', # DE!
    'username' => '[email protected]', #E-Mail de autenticação
    'password' => '12345', #Senha do e-mail para autenticar
    'ssl' => 'ssl', #Tipo do envio
    )
    ),
    );
    1 change: 1 addition & 0 deletions model.php
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    <?php
    public function getServiceConfig()
    {

  2. juizmill created this gist Sep 28, 2013.
    25 changes: 25 additions & 0 deletions model.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    public function getServiceConfig()
    {

    return array(
    'factories' => array(
    'Contato\Mail\Transport' => function($sm) {
    $config = $sm->get('Config');

    $transport = new SmtpTransport;

    $options = new SmtpOptions($config['mail']);
    $transport->setOptions($options);

    return $transport;
    },
    'Contato\Service\Contato' => function($sm) {
    return new Service\Contato($sm->get('Contato\Mail\Transport'),$sm->get('View'));
    }



    )
    );

    }