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
319 stars 148 forks source link

Uncaught TypeError: Argument 1 passed to MagePal\GmailSmtpApp\Model\ZendMailTwo\Smtp::sendSmtpMessage() #167

Closed jamie-selesti closed 4 years ago

jamie-selesti commented 4 years ago

Magento version #:

Magento 2.3.3

Edition (EE, CE, OS, etc):

CE

Expected behavior:

To receive 2 emails

  1. Hello from MagePal SMTP (1 of 2)

  2. Hello from MagePal SMTP (2 of 2)

Actual behavior:

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to MagePal\GmailSmtpApp\Model\ZendMailTwo\Smtp::sendSmtpMessage() must implement interface Magento\Framework\Mail\MessageInterface, instance of Magento\Framework\Mail\EmailMessage given, called in /var/www/vhosts/domain.com/vendor/magepal/magento2-gmailsmtpapp/Plugin/Mail/TransportPlugin.php on line 71 and defined in /var/www/vhosts/domain.com/vendor/magepal/magento2-gmailsmtpapp/Model/ZendMailTwo/Smtp.php:112
Stack trace:
#0 /var/www/vhosts/domain.com/vendor/magepal/magento2-gmailsmtpapp/Plugin/Mail/TransportPlugin.php(71): MagePal\GmailSmtpApp\Model\ZendMailTwo\Smtp->sendSmtpMessage(Object(Magento\Framework\Mail\EmailMessage))
#1 /var/www/vhosts/domain.com/vendor/magento/framework/Interception/Interceptor.php(135): MagePal\GmailSmtpApp\Plugin\Mail\TransportPlugin->aroundSendMessage(Object(Magento\Email\Model\Transport\Interceptor), Object(Closure))
#2 /var/www/vhosts/domain.com/vendor/magento/module-email/Model/Mail/TransportInterfacePlugin.php( in /var/www/vhosts/domain.com/vendor/magepal/magento2-gmailsmtpapp/Model/ZendMailTwo/Smtp.php on line 112

Steps to reproduce:

Send test email using the built-in "Test Email Server Configuration Settings" functionality

Preconditions

Based on https://github.com/magepal/magento2-gmail-smtp-app/issues/166 I have now upgraded to v 2.8.0 and this is the latest error

jamie-selesti commented 4 years ago

As an update, if I downgrade to v2.7.0 everything works as expected. Therefore the issues are related to v2.7.1 and v2.80

webspeaks commented 4 years ago

I a getting same issue in Magento 2.3.3 EE after upgrading the SMTP extension to 2.8.0

srenon commented 4 years ago

@jamie-selesti @webspeaks ... please try 2.8.1