This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » project:send-emails dont work because strategy always none
project:send-emails dont work because strategy always none [message #93956] Sun, 21 February 2010 00:02 Go to next message
adrianrz  is currently offline adrianrz
Messages: 18
Registered: July 2009
Location: Argentina
Junior Member
Hello,

I use spool strategy from the contact form and all work fine:
the class save the table register (at mail-message table)
but when i run send-email task, show a red message:
You can only send messages in the spool if the delivery strategy is "spool" (none is the current strategy). and stop the task script.

The factory.yml
mailer:
    class: sfMailer
    param:
      charset: iso-8859-1                        # charset to use : utf-8, iso-8859-1, ...
      encoding: 8bit                             # 7bit, 8bit, quoted-printable, base64 (default : quoted-printable)
      delivery_strategy: spool
      spool_class:       Swift_DoctrineSpool
      spool_arguments:   [ MailMessage, message, getSpooledMessages ]
      transport:
        class: Swift_SmtpTransport
        param:
          host:       localhost
          port:       25
          encryption: ~
          username:   ~
          password:   ~  


I have clear the cache and the i have verify the cache factory generated file (config_factories.yml.php) and all is well
require_once sfConfig::get('sf_symfony_lib_dir').'/vendor/swiftmailer/classes/Swift.php';
Swift::registerAutoload();
sfMailer::initialize();
$this->setMailerConfiguration(array_merge(array('class' => sfConfig::get('sf_factory_mailer', 'sfMailer')), sfConfig::get('sf_factory_mailer_parameters', array (
  'logging' => '',
  'charset' => 'iso-8859-1',
  'delivery_strategy' => 'spool',
  'transport' => 
  array (
    'class' => 'Swift_SmtpTransport',
    'param' => 
    array (
      'host' => 'localhost',
      'port' => 25,
    ),
  ),
  'encoding' => '8bit',
  'spool_class' => 'Swift_DoctrineSpool',
  'spool_arguments' => 
  array (
    0 => 'MailMessage',
    1 => 'message',
    2 => 'getSpooledMessages',
  ),
))));


Anybody help me?

Thanks in advance.

Adrián
Re: project:send-emails dont work because strategy always none [message #94033 is a reply to message #93956 ] Mon, 22 February 2010 15:22 Go to previous messageGo to next message
adrianrz  is currently offline adrianrz
Messages: 18
Registered: July 2009
Location: Argentina
Junior Member
I'm still investigating but no solution yet. I'm really thinking this is a bug, but still do not know where it is.

Nobody has used eset task, to exchange ideas about my problem?

Thanks

Adrián
[Solved]: project:send-emails dont work because strategy always none [message #94049 is a reply to message #93956 ] Mon, 22 February 2010 17:18 Go to previous messageGo to next message
adrianrz  is currently offline adrianrz
Messages: 18
Registered: July 2009
Location: Argentina
Junior Member
As usual, I answer myself.
On page http://www.symfony-project.org/more-with-symfony/1_4/en/04-E mails
explains the command send-emails this way
$ php symfony project: send-email - message-limit = 10 - time-limit = 20
but above says that you have to declare -- env and --application, which I omitted.

the right way is:

$ php symfony project: send-email --application="frontend" --env="prod" --message-limit = 10 --time-limit = 20


I hope my mistake will serve someone.

Thanks

[Updated on: Mon, 22 February 2010 18:55]

Re: [Solved]: project:send-emails dont work because strategy always none [message #99234 is a reply to message #94049 ] Mon, 17 May 2010 22:09 Go to previous messageGo to next message
nei_rauni  is currently offline nei_rauni
Messages: 5
Registered: July 2008
Location: Curitiba, Paraná, Brazil
Junior Member
specifying the application and env it works..

but i'm getting this error:

nei.rauni@lula:~/projetos/booking/trunk/cache$ sf project:send-email --application="frontend" --env="prod" 
PHP Fatal error:  Call to a member function clearAll() on a non-object in /usr/share/php/symfony/vendor/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php on line 790
PHP Stack trace:
PHP   1. {main}() /usr/bin/symfony:0
PHP   2. include() /usr/bin/symfony:37
PHP   3. sfSymfonyCommandApplication->run() /usr/share/php/symfony/command/cli.php:20
PHP   4. sfTask->runFromCLI() /usr/share/php/symfony/command/sfSymfonyCommandApplication.class.php:76
PHP   5. sfBaseTask->doRun() /usr/share/php/symfony/task/sfTask.class.php:97
PHP   6. sfProjectSendEmailsTask->execute() /usr/share/php/symfony/task/sfBaseTask.class.php:68
PHP   7. sfMailer->flushQueue() /usr/share/php/symfony/task/project/sfProjectSendEmailsTask.class.php:61
PHP   8. Swift_DoctrineSpool->flushQueue() /usr/share/php/symfony/mailer/sfMailer.class.php:315
PHP   9. unserialize() /usr/share/php/symfony/plugins/sfDoctrinePlugin/lib/mailer/Swift_DoctrineSpool.class.php:111
PHP  10. Swift_Mime_SimpleMimeEntity->__destruct() /usr/share/php/symfony/vendor/swiftmailer/classes/Swift/Mime/SimpleMimeEntity.php:0



my symfony version is 1.3.4, and php 5.3.2

Any information about it?
Re: [Solved]: project:send-emails dont work because strategy always none [message #102642 is a reply to message #99234 ] Sat, 17 July 2010 02:21 Go to previous message
omoratin  is currently offline omoratin
Messages: 144
Registered: December 2005
Senior Member
Hi

I'm having the same issue. I know it's been 2 years so maybe you know why this SimpleMimeEntity error happens.
Thanks
Previous Topic:[SOLVED] Doctrine Sluggable. Where is getSlug()?
Next Topic:Currency Converter (sfRatePlugin)
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software