phalcon / incubator

Incubator adapters/functionality for the Phalcon PHP Framework
Other
731 stars 339 forks source link

Mailer problem #541

Closed XartIrok closed 8 years ago

XartIrok commented 8 years ago

error

Service '\Swift_SmtpTransport' wasn't found in the dependency injection container

section to load

        $loader->registerNamespaces(
            array(
                "Phalcon" => APP_PATH.'vendor/phalcon/incubator/Library/Phalcon/'
            )
        );

        $eventsManager = new EventsManager();
        $eventsManager->attach('loader', function ($event, $loader) {
           if ($event->getType() == 'beforeCheckPath') {
               echo $loader->getCheckedPath();
           }
        });

        $loader->setEventsManager($eventsManager);
        $loader->register();

        $di->set('mailer', function () use ($config) {
            return new MailerSend($config->mailer->toArray());
        });

i use composer to install, mayby there is wrong

{
  "require": {
    "phalcon/incubato": "^2.0"
  },
  "config": {
    "vendor-dir": "vendor"
  }
}
sergeyklay commented 8 years ago

Composer way:

Use composer.json as follows:

{
    "require": {
        "phalcon/incubator": "^2.0"
    }
}

then run the composer installer:

$ php composer.phar install

and use something like

include_once vendor/autoload.php

without $loader->registerNamespaces

XartIrok commented 8 years ago

i must say is strange, but now is working thanks

maxttor commented 5 years ago

I have same problem.

I use include_once vendor/autoload.php in bootstrap file but have the problem.

maxttor commented 5 years ago

Swift 6.0.0 (2017-05-19) CHANGES: removed Swift_MailTransport and Swift_Transport_MailTransport

How now I can use driver "mail" ?

zeoharlem commented 3 years ago

$helper->getLoginUrl(your_redirect_url, ['email']);

add the email scope like the above example... this solved the problem for me