Phalcon CLI not sending email using Vokuro Code

Dear Members, I am using vokuro Mail plugin in my CLI code. The code sends emails whenever an order is created successfully in the database. Here is the afterCreate() code for sending emails.

<?php
$this->getDI()
             ->getMail()
             ->send($recipients, "Order Notification", 'orderstatus1', array(
             'cname' => $this->customers->name,
             'cemail' => $this->customers->email,
             'mobile' => $this->customers->mobile,
             'customerid' => $this->customers->customerid,
             'facility' => $this->membership->facilities->facilityname,
             'transactionstatus' => (!empty($this->transactionstatus)) ? $this->transactionstatus : "",
             'qid' => $this->customers->qid,
             'mid' => $this->membershipid,
             'dob' => $this->customers->dob,
             'nationality' => $this->customers->nationality,
             'startdate' => $this->membership->membershipdate,
             'enddate' => $this->membership->membershipexpirydate,
             'orderdate' => $this->orderdate,
             'membershiptype' => $this->membership->packages->packagedesc,
             'orderamount' => $this->membership->packages->packageamount,
             'facilityname' => $this->membership->facilities->facilityname,
             'paymentoption' => $this->membership->packages->paymentoption,
             'facilityimage' => $this->membership->facilities->facilityimage
        )
);

I have created a task for creating orders manually. But on successful creation of orders, I get the email text printed on my terminal but the email is never sent. Same works when its doen from website. I am using the flollowing command for the same.

/usr/bin/php-cli /home/xxx/public_html/xxxx/app/bootstrap_cli.php paymentprocessor

And then my terminal fills with email template that i have set but email does not send. Here is the sample output. https://ibb.co/QC7j8Mm

Any help will be appreciated.



3.3k

could be an issue with php cli using a different php.ini

did you check that afterCreate() actually gets excuted

could be an issue with php cli using a different php.ini

did you check that afterCreate() actually gets excuted

Yes, it does executes because my email template gets printed on my screen as shown in the screenshot.



3.3k

my bet is on php.ini

Try to wrap the code with try catch and see if there are any errors.

my bet is on php.ini

Sorry, I could not understand that. What should be I looking in 'php.ini'? Can you put me in the right direction?



3.3k

i would first go with @Jeckerson first

make sure all errors will show up error_reporting(E_ALL);

and wrap with try catch Throwable

if that didn't shed any light

you can check if there a difference with both php.inis anything would affect mail()