cakephp 3.x mail is not working properly in live server

白昼怎懂夜的黑 提交于 2019-12-02 19:30:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!