symfony1 - Symfony mailer: Swift_TransportException between message sending -


on current project i'm working, have symfony task runs mass data insertion database , runs @ least half hour. when task starts mail notification sent correctly, problem @ of task execution can't send mail notify end of processing.

the mailer factory configured spool delivery strategy but, in specific situation, desire fire notification immediately, using sendnextimmediately() method.

i'm getting exception:

[swift_transportexception]
expected response code 250 got code "451", message "451 4.4.2 timeout - closing connection. 74sm1186065wem.17 "

and flowing error on php log file:

warning: fwrite(): ssl: broken pipe in /var/www/project/lib/vendor/symfony/lib/vendor/swiftmailer/classes/swift/transport/streambuffer.php on line 209

can give help? there way can perhaps refresh symfony mailer establish new connection?

doing symfony2 project, ran across failure too. using permanently running php script, produced error.

we figured out following code job:

private function sendemailmessage($renderedtemplate, $subject, $toemail)     {         $mailer = $this->getcontainer()->get('mailer');         /* @var $mailer \swift_mailer */         if(!$mailer->gettransport()->isstarted()){             $mailer->gettransport()->start();         }         $sendexception = null;         /* @var $message \swift_message */         $message = \swift_message::newinstance()             ->setsubject($subject)             ->setfrom($this->getcontainer()->getparameter('email_from'))             ->setto($toemail)             ->setbody($renderedtemplate);           $mailer->send($message);         $mailer->gettransport()->stop();         //throw $sendexception;     } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -