Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email queue fails if SMTP Transport is being used (CakePHP v3.x) #70

Closed
azmyth opened this issue Feb 12, 2016 · 3 comments
Closed

Email queue fails if SMTP Transport is being used (CakePHP v3.x) #70

azmyth opened this issue Feb 12, 2016 · 3 comments
Labels
Milestone

Comments

@azmyth
Copy link

azmyth commented Feb 12, 2016

Using Mail transport

---------------------------------------------------------------
Looking for Job....
Running Job of type "Email"
Job Finished.
---------------------------------------------------------------

Using SMTP transport - (email changed)

Looking for Job....
Running Job of type "Email"
2016-02-12 02:43:55 Error: Cake\Mailer\Transport\SmtpTransport - TO:testing@gmail.com||FROM:testing2@gmail.com||REPLY:||S:testing
2016-02-12 02:43:55 Error: SMTP Error: 501 <>: missing or malformed local part (line 449 in C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Mailer\Transport\SmtpTransport.php)
#0 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Mailer\Transport\SmtpTransport.php(366): Cake\Mailer\Transport\SmtpTransport->_smtpSend('RCPT TO:<>')
#1 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Mailer\Transport\SmtpTransport.php(168): Cake\Mailer\Transport\SmtpTransport->_sendRcpt(Object(Tools\Mailer\Email))
#2 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Mailer\Email.php(1303): Cake\Mailer\Transport\SmtpTransport->send(Object(Tools\Mailer\Email))
#3 C:\xampp\htdocs\cakeproj\vendor\dereuromark\cakephp-tools\src\Mailer\Email.php(463): Cake\Mailer\Email->send(NULL)
#4 C:\xampp\htdocs\cakeproj\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php(113): Tools\Mailer\Email->send(NULL)
#5 C:\xampp\htdocs\cakeproj\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php(212): Queue\Shell\Task\QueueEmailTask->run(Array, 45)
#6 [internal function]: Queue\Shell\QueueShell->runworker()
#7 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Console\Shell.php(444): call_user_func_array(Array, Array)
#8 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(217): Cake\Console\Shell->runCommand(Array, true, Array)
#9 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(181): Cake\Console\ShellDispatcher->_dispatch(Array)
#10 C:\xampp\htdocs\cakeproj\vendor\cakephp\cakephp\src\Console\ShellDispatcher.php(127): Cake\Console\ShellDispatcher->dispatch(Array)
#11 C:\xampp\htdocs\cakeproj\bin\cake.php(33): Cake\Console\ShellDispatcher::run(Array)
#12 {main}
Job did not finish, requeued.

The code used:

        $this->loadModel('Queue.QueuedTasks');
        $this->QueuedTasks->createJob('Email', [
            'settings' => [
                'to' => ['testing@gmail.com'],
                'from' => ['testing2@gmail.com'],
                'subject' => 'testing',
                'template' => 'registration',
                'emailFormat' => 'html'
            ],
            'vars' => [
                'name' => 'tester'
            ]
        ]);

Can you please advice on the issue?

Thanks and great work on the plugin. Keep it up.

@azmyth azmyth changed the title Email queue fails if SMTP Transport is being used Email queue fails if SMTP Transport is being used (CakePHP v3.x) Feb 12, 2016
@dereuromark dereuromark added this to the 3.x milestone Feb 12, 2016
@dereuromark
Copy link
Owner

Sure, that arrays are allowed? Instead of

'to' => ['testing@gmail.com'],

did you try

'to' => 'testing@gmail.com',

?
Same for from (especially since that can only contain one email).

@azmyth
Copy link
Author

azmyth commented Feb 22, 2016

Hi Mark,

Thanks for getting back to me. The error are still the same even without array tag.

Looking for Job....
Running Job of type "Email"
2016-02-22 01:21:43 Error: Cake\Mailer\Transport\SmtpTransport - TO:testing@gmail.com||FROM:testing2@gmail.com||REPLY:||S:testing
2016-02-22 01:21:43 Error: SMTP Error: 501 <>: missing or malformed local part (line 449 in C:\xampp\htdocs\webcash\vendor\cakephp\cakephp\src\Mailer\Transport\SmtpTransport.php)

@dereuromark
Copy link
Owner

Can you please debug it and find out what email fails and why? I suspect you forgot one config or alike.
But this has nothing to do with the queue itself, it is basically invalid Email class setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants