WAMP is not sending emails
Posted by: jagguy (---.lnk.telstra.net)
Date: August 25, 2016 06:14AM

Hi, I can't get cakephp3 to send emails. In cakephp2 I could do this no problem. I am using the latest WAMP, and cakephp3.3 on Windows 7. I tried to follow the directions but it looks like I am getting something basic wrong. Do I also need to configure Wamp as I checked the php.ini file but there is no smtp entry to change

I believe the error is a WAMP setup for smtp because the code for cakephp3 is correct after I checked this out.


error- stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086confused smileySL routinesconfused smileySL3_GET_SERVER_CERTIFICATE:certificate verify failed stream_socket_client(): Failed to enable crypto stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error)

in php.ini


SMTP = smpt.gmail.com
smtp_port = 465
sendmail_path ="D:\wamp64\sendmail\sendmail.exe"
sendmail_from ="xxxxx@gmail.com"

Options: ReplyQuote
Re: WAMP is not sending emails
Posted by: RiggsFolly (Moderator)
Date: August 25, 2016 10:07AM

IS this an SSL / TSL issue, email servers have got a little more particular recently

Check your email settings has 'tls' => true

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMP is not sending emails
Posted by: jagguy (---.lnse5.lon.bigpond.net.au)
Date: August 25, 2016 02:27PM

I stil get the same error with that line- this is what I get with 'tls' => true

stream_socket_client(): SSL operation failed with code 1. 
OpenSSL Error messages: error:14090086: SSL routines: SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 
stream_socket_client(): 
Failed to enable crypto stream_socket_client(): 
unable to connect to ssl://smtp.gmail.com:465 (Unknown error)



Edited 2 time(s). Last edit at 08/25/2016 04:40PM by RiggsFolly.

Options: ReplyQuote
Re: WAMP is not sending emails
Posted by: RiggsFolly (Moderator)
Date: August 25, 2016 04:42PM

I cannot remember how cake sends email, foes it use phpMailer or sendmail?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: WAMP is not sending emails
Posted by: jagguy (---.lnse5.lon.bigpond.net.au)
Date: August 26, 2016 06:42AM

The issue is not cakephp it is WAMP as my code is correct

   $email = new Email();
        $email->transport('gmail3');
        
       $to='xxx9@gmail.com';
       $subject='testing';
       $message='hello, dfsfsdfsdf sdfsdf';
       
        $email->from(['xxx@gmail.com' => 'test'])
                  ->to($to)
                  ->subject( $subject)                   
                  ->send($message);


 'gmail3' => [
             'className' => 'Smtp',
             'host' => 'ssl://smtp.gmail.com',
            'port' => 465,
            'timeout' => 30,
            'username' => 'xx@gmail.com',
            'password' => 'xxxx',
            'client' => null,
             'tls' => true
          
        ],
    ],



Edited 1 time(s). Last edit at 08/26/2016 09:52AM by RiggsFolly.

Options: ReplyQuote
Re: WAMP is not sending emails
Posted by: RiggsFolly (Moderator)
Date: August 26, 2016 10:05AM

What version of PHP are you using, in fact can you answer these question please [forum.wampserver.com]

Also have you seen this in the cakephp 3.1 manual

Quote

You will need to have access for less secure apps enabled in your Google account for this to work:
[support.google.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.