0

Am using swift mailer to send emails for my symfony application.But it is throwing the error: There is no extension able to load the configuration for "transport". I am getting the error when it loads the configuration file the app is crashed. Please help me to know how can I exact define it's configuration parameters. My app/config.yml is like:

swiftmailer:
transport: gmail
username: 'myemail@example.com'
password: 'Mypassword'

I have also checked app/Appkernel.php swiftmailer bundle is already registered:

public function registerBundles()
{
    $bundles = array(
        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        new Symfony\Bundle\SecurityBundle\SecurityBundle(),
        new Symfony\Bundle\TwigBundle\TwigBundle(),
        new Symfony\Bundle\MonologBundle\MonologBundle(),
        new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
        new Symfony\Bundle\AsseticBundle\AsseticBundle(),
        new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
        new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
        new Acme\SuperbAppBundle\AcmeSuperbAppBundle(),
    );

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
        $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
        $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
    }

    return $bundles;
}

Am using the following code to send email:

      $message = \Swift_Message::newInstance() 
      ->setSubject('Hello Email') // we configure the title
      ->setFrom('myemail@example.com') // we configure the sender
      ->setTo('someone@example.com') // we configure the recipient
      ->setBody("Hello User");


      $send = $this->get('mailer')->send($message); // then we send the message.
Randhir
  • 735
  • 4
  • 11
  • 22

1 Answers1

1

Your indentation is wrong. It should be like..

swiftmailer:
    transport: gmail
    username: 'myemail@example.com'
    password: 'Mypassword'
qooplmao
  • 17,622
  • 2
  • 44
  • 69
  • That could be a variety of things: incorrect details, spool not emptying, etc. I would try opening a new question with your question and details. – qooplmao Jul 10 '14 at 11:52