CakeEmail not sending, but no errors

前端 未结 1 945
长发绾君心
长发绾君心 2021-01-25 15:39

I\'m pretty new to CakePHP and this is my first attempt setting up an email form.

Keeping the example simple:



        
相关标签:
1条回答
  • 2021-01-25 15:56

    Before this you need to define Email configuration in email.php under Config folder

    Here we have gmail configuration for example

    class EmailConfig {
        public $gmail = array(
            'host' => 'ssl://smtp.gmail.com',
            'port' => 465,
            'username' => 'username@gmail.com',
            'password' => '*****',
            'transport' => 'Smtp'
        );
    }
    

    then you can use this setting in controller like

    $Email= new CakeEmail('gmail');
    

    Inshort you have to configure SMTP according to requirement. I hope this will be handy for you. Thanks

    0 讨论(0)
提交回复
热议问题