-
Notifications
You must be signed in to change notification settings - Fork 137
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
Cannot send email #151
Comments
How did you add a job? You need to paste your code here and the data you are passing to it. |
I've the same error. Configuration: 'EmailTransport' => [
'default' => [
'className' => 'Smtp',
// The following keys are used in SMTP transports
'host' => 'host',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'tls' => null,
],
'queue' => [
'className' => 'Queue.Queue',
'transport' => 'default'
],
],
'Email' => [
'default' => [
'transport' => 'queue',
'from' => 'mail@example.com',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
],
], Send an E-Mail in a controller: $email = new \Cake\Mailer\Email('default');
$email->from(['mail@example.com' => 'Example'])
->to('mail@example.com')
->subject('About')
->send('My message'); The $data in method
[
'transport' => 'default',
'settings' => [
'viewConfig' => [
'_layout' => 'default',
'_className' => 'Cake\View\View',
'_helpers' => [
(int) 0 => 'Html'
]
],
'_to' => [
'mail@example.com' => 'mail@example.com'
],
'_from' => [
'mail@example.com' => 'Example'
],
'_subject' => 'About',
'_emailFormat' => 'text',
'_emailPattern' => '/^((?:[\p{L}0-9.!#$%&'*+\/=?^_`{|}~-]+)*@[\p
{L}0-9-.]+)$/ui',
'_domain' => '******',
'_messageId' => true,
'_appCharset' => 'UTF-8',
'charset' => 'utf-8',
'headerCharset' => 'utf-8'
]
] |
Do you have an idea of a fix as PR? |
I think it is because of commit 7ab4d15 "Use json_encode() instead of serialize". JSON can not be converted back to an PHP object. Instead of it is always converted into an array. And the line
What was the reason to switch from serialize to json_encode? |
Maybe also security issue I think? Is there a way to jeep json_encode() and provide a mapping here for the option/config setting etc? |
At the moment I do not see another way than reading out every configuration by calling all getters in I tried something with Or has anyone an other idea? |
We can also switch back to the serialize then for the time being. Please make a PR. |
Working fine now! |
Hope that I can get answer here
I have already install a new cakephp dan cakephp-queue on my machine. But it didn't work when queueworker send the email.
I always get this error :
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method 'viewConfig' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_to' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_from' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_subject' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_emailFormat' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_emailPattern' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_domain' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_messageId' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Warning: Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Cake\Mailer\Email' does not have a method '_appCharset' in [D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110]
Trace:
Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153
Queue\Shell\Task\QueueEmailTask::run() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php, line 110
Queue\Shell\QueueShell::runworker() - ROOT\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php, line 169
Cake\Console\Shell::runCommand() - CORE\src\Console\Shell.php, line 494
Cake\Console\CommandRunner::run() - CORE\src\Console\CommandRunner.php, line 141
[main] - ROOT\bin\cake.php, line 12
2017-10-16 07:08:44 Error: QueueEmail
BadMethodCallException: You need specify one destination on to, cc or bcc.
#0 D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\Task\QueueEmailTask.php(126): Cake\Mailer\Email->send(NULL)
#1 D:\xampp\htdocs\e-commerce\vendor\dereuromark\cakephp-queue\src\Shell\QueueShell.php(169): Queue\Shell\Task\QueueEmailTask->run(Array, 8)
#2 D:\xampp\htdocs\e-commerce\vendor\cakephp\cakephp\src\Console\Shell.php(494): Queue\Shell\QueueShell->runworker()
#3 D:\xampp\htdocs\e-commerce\vendor\cakephp\cakephp\src\Console\CommandRunner.php(141): Cake\Console\Shell->runCommand(Array, true)
#4 D:\xampp\htdocs\e-commerce\bin\cake.php(12): Cake\Console\CommandRunner->run(Array)
#5 {main}
The text was updated successfully, but these errors were encountered: