Her gün otomatik olarak bir e-posta göndermek için bir komut oluşturuyorum.E-posta gönderme komutu oluşturma - Laravel 5.2
Böyle komutu kuruyorum: Böyle
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
class SendEmail extends Command
{
protected $signature = 'emails:send';
protected $description = 'Sending emails to the users.';
public function __construct()
{
parent::__construct();
}
public function handle()
{
$data = array(
'name' => "МГ 'Константин Величков', гр. Пазарджик",
);
Mail::send('emails.test', $data, function ($message) {
$message->from('[email protected]', 'МГ "Константин Величков"');
$message->to('[email protected]')->subject('Оценки');
});
$this->info('The emails are send successfully!');
}
}
Sonra Çekirdeği'nde kaydetmek:
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected $commands = [
Commands\Inspire::class,
Commands\SendEmail::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command('emails:send')->daily();
}
}
Bütün esnaf komutları listeleyen ediyorum ve benim yeni COMAND görebilirsiniz
[Swift_TransportException]
Process could not be started [The system cannot find the path specified.
]
: -: e-postalar bu nedenle onun yarattığı, ama o
(php artisan emails:send)
çalıştırmayı denediğinizde ben bu got göndermekSorun nedir?
'$ transport = Swift_MailTransport :: newInstance();' –
Ve bunu nereye koydum? –