magepal / magento2-gmail-smtp-app

Configure Magento 2 to send email using Google App, Gmail, Amazon Simple Email Service (SES), Microsoft Office365 and many other SMTP (Simple Mail Transfer Protocol) servers
https://www.magepal.com
321 stars 147 forks source link

Need help.can't send mail. #9

Closed shuaiZend closed 8 years ago

shuaiZend commented 8 years ago

test send is okay. but other email can't send. have any log file?where?

troncar commented 8 years ago

I have the same problem

srenon commented 8 years ago

@shuaiZend @troncar ... What version of magento and php are you running?

troncar commented 8 years ago

Magento 2.0.2

srenon commented 8 years ago

What PHP version?

shuaiZend commented 8 years ago

@srenon PHP7 and Magento2.0.2

srenon commented 8 years ago

@shuaiZend

This is a bug in magento when using php7 where the encrypting and decrypting of system config not working correctly. Also see https://github.com/magepal/magento2-gmailsmtpapp/issues/8

See Issue

https://github.com/magento/magento2/issues/2984

https://github.com/magento/magento2/issues/1223

To fix this issue see

https://github.com/magento/magento2/commit/32ca5c97304a1bd84cfbee7cec3d57c9307da9a6 or https://github.com/magento/magento2/pull/3054/files

shuaiZend commented 8 years ago

@srenon thank you. i fixed this. used https://github.com/magento/magento2/commit/32ca5c97304a1bd84cfbee7cec3d57c9307da9a6

shuaiZend commented 8 years ago

@srenon i used your last version...notice 5.7.8 Username and Password not accepted But I still use the previous version's user name and password。 Previous versions can be email.

[2016-03-20 18:45:38] main.CRITICAL: Exception message: 5.7.8 Username and Password not accepted. Learn more at^M
 5.7.8  https://support.google.com/mail/answer/14257 yy7sm10584180obb.26 - gsmtp^M

Trace: #0 /home/wwwroot/mysite/vendor/magento/module-newsletter/Controller/Subscriber/NewAction.php(124): Magento\Newsletter\Model\Subscriber->subscribe('shuai.zend@hotm...')
#1 /home/wwwroot/mysite/var/generation/Magento/Newsletter/Controller/Subscriber/NewAction/Interceptor.php(24): Magento\Newsletter\Controller\Subscriber\NewAction->execute()
#2 /home/wwwroot/mysite/vendor/magento/framework/App/Action/Action.php(102): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->execute()
#3 [internal function]: Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /home/wwwroot/mysite/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#5 /home/wwwroot/mysite/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Newsletter\Controller\Subscriber\NewAction\Interceptor->___callParent('dispatch', Array)
shuaiZend commented 8 years ago

@srenon I try to compare the two databases Email password field in core_config_data. I found a version of the password is encrypted, the latest version is not encrypted.

srenon commented 8 years ago

Try re-saving ... and check the password again.

I just reenter my password on php 5.x, then check the password and it is encrypted.

So this must be a php7 or the changes you make issue.

Also what do you mean by previous and latest version?

shuaiZend commented 8 years ago

I try re-saving password again. but still can't send email. last version is 1.1, previous version is 1.0. version 1.1 in databases is not encrypted email password.

srenon commented 8 years ago

Undo the changes you made for php7 and try saving again

shuaiZend commented 8 years ago

I rollback data.php in php7. and run cil cache:flush and resaving password again. still not encrypted.

srenon commented 8 years ago

Try doing bin/magento setup:upgrade instead. I just test on the dev branch without any issue

shuaiZend commented 8 years ago

image

image still not encrypted.

srenon commented 8 years ago

A quick way to test to see if this is issue only affect this module is to enable another module that encrypt password (uses <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>) eg payment module. Then look at the value in the database

troncar commented 8 years ago

@shuaiZend PHP: 5.6.15

srenon commented 8 years ago

@troncar ... they should not be any issue with php 5.x. Follow these steps to debug https://github.com/magepal/magento2-gmailsmtpapp/issues/8