I am using cakephp 3.x. The email is working properly in localhost but not in case of live server. It is simultaneously giving error like "Transport class "SMTP" not found.".I have been stuck from long time. Please provide good solution for it.Why it is happening and what should I have to do? here is my config/app page
'EmailTransport' => [
'default' => [
'className' => 'SMTP',
// The following keys are used in SMTP transports
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'timeout' => 30,
'username' => 'mardshehenshah@gmail.com',
'password' => '*******',
// 'client' => null,
// 'tls' => null,
// 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
],
],
'Email' => [
'default' => [
'transport' => 'default',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
],
],
Here is my controller :
$email = new Email('default');
$email->from(['Abc@gmail.com' => 'Model Broucher Information'])
->emailFormat('html')
->to($emailAddRess)
->subject('About')
->send($msg);
来源:https://stackoverflow.com/questions/46807458/cakephp-3-x-mail-is-not-working-properly-in-live-server