Symfony 假脱机电子邮件发送有限的电子邮件

问题描述 投票:0回答:0

我是 Symfony 框架的新手。我的项目有 Symfony 2.8,它运行在 PHP 5.5 上。有一个功能,我们必须发送带附件的电子邮件。客户端应该收到超过 15 封电子邮件,但它始终只收到 4 封电子邮件。它与假脱机内存有什么关系还是我们必须增加服务器内存?我试图打印

$this->get('mailer')->send($message)
的响应,但它总是返回1。这是函数代码:

        $em = $this->getDoctrine()->getManager();
        $currentUrl = $request->getHost();

        //To Send the report to user name list that should recieve emails
        $this->generateUserReport($request);
       
        $sql = "select user, name from table;";
        $stmt = $em->getConnection()->prepare($sql);
        $stmt->execute();
        $ApiUsers = $stmt->fetchAll();

        //API Usage Reports
        if (count($ApiUsers) > 0) {
            foreach ($ApiUsers as $ApiUser) {
               //This run multiple time
               $attachments = [];
                $attachment = $this->generateCSV($em, "data1", "data2", $user);
                if ($attachment != "") {
                    $attachments[] = $attachment;
                }
                if (count($attachments) > 0) {
                    $this->sendemail("", "Admin", "apireport", "API Report" , $request, "[email protected]", $attachments, $user,"yes");  
                  // die("testing for");          
                }
            }
        }

我们检查了服务器日志但没有错误。如果问题重复,我将删除该问题。请分享重复的一个。

swiftmailer symfony-2.8 php-5.5 spool
© www.soinside.com 2019 - 2024. All rights reserved.