i wanted ask sending emails in cakephp3.
i using cakephp3 docs, , configured example shows.
but, when try send mail, error appears:
could not send email: unknown
//app.php 'emailtransport' => [ 'default' => [ 'classname' => 'mail', // following keys used in smtp transports 'host' => 'smtp.gmail.om', 'port' => 465, 'timeout' => 30, 'username' => 'mymail@gmail.com', 'password' => 'password', 'client' => null, 'tls' => null, ], ], contactcontroller:
public function contact() { if (isset($this->request->data) , ($this->request->is('post'))) { $email = new email('default'); if ($email->from(['mymail@gmail.com' => 'my site'])->to('othermail@gmail.com')->subject('hello')->send('message')) { //pr( 'ok'); } } } is generic error message (, may have many reasons, in opinion)? has no value in context of debug.
you want use smtp server, you've configured use mail transport!
the classname option should set smtp. host should different (ssl:// prefixed), or should enable tls, please sure read through questions/answers found search linked below.
see also
Comments
Post a Comment