zf1-future icon indicating copy to clipboard operation
zf1-future copied to clipboard

Zend_Mail SMTP Oauth2 / XOauth2

Open icyz opened this issue 2 years ago • 9 comments

Google has stopped providing "Less secure app access" to third party applications. This means that from Zend_Mail we will no longer be able to send emails using gmail.

Does anyone have any idea how to get Zend_Mail working again with Oauth2 or XOauth2?

icyz avatar Jun 17 '22 13:06 icyz

@icyz i have package help Zend_Mail working again with Oauth2 here https://packagist.org/packages/hungtrinh/zend-mail-oauth2

hungtrinh avatar Jul 19 '22 08:07 hungtrinh

Thanks @hungtrinh, I will try it as soon as possible. I think it's Oauth2 could be integrated in zf1-future instead use external package :-)

icyz avatar Jul 20 '22 09:07 icyz

After install: Fatal error: Cannot declare class Zend_Cache, because the name is already in use in /library/Zend/Cache.php on line 28

I will investigate

icyz avatar Jul 22 '22 14:07 icyz

@icyz oops, look like you integrate hungtrinh/zend-mail-oauth2 with full zend framework 1 (library/Zend existed) => i guess that conflict with requires package zf1s/zend-mail: ^1.14 in this case may be i need move zf1s/zend-mail: ^1.14 into composer suggest section instead of requires section

Or you can follow this guide https://github.com/hungtrinh/zend-mail-oauth2#setup-autoload-zend-mail-oauth2-for-zend-framework-1-skeleton-project

hungtrinh avatar Jul 25 '22 02:07 hungtrinh

Alternatively, you can create a new authorization method for OAuth2 and save it in Zend/Mail/Protocol/Smtp/Auth. Check out this blog post: http://piecewiseinc.blogspot.com/2013/02/send-mail-with-gmail-smtp-and-xoauth.html

woranl avatar Jan 05 '23 22:01 woranl

Anyone to own this and create PR, pls?

develart-projects avatar Aug 10 '23 08:08 develart-projects

Anyone to own this and create PR, pls?

it's easy to extract code from https://packagist.org/packages/hungtrinh/zend-mail-oauth2 but I think it's better if we keep origin zf1-future functional, try make it back compatible, and forward compatible with php version 8++

hungtrinh avatar Aug 11 '23 09:08 hungtrinh

@hungtrinh if someone has initiative, I'm not against it :)

develart-projects avatar Aug 11 '23 09:08 develart-projects

@hungtrinh btw, you are right, that we have to be very cautious here, as some changes and new function can potentially override already inherited methods. Therefore I'll make as clear as possible, that some new functionality is comming. Thanks for bringing this into the discussion.

develart-projects avatar Aug 11 '23 10:08 develart-projects