Problem/Motivation

Due to the BC break in PHPMailer 6.11.x these changes were reverted in 6.12.x. https://github.com/PHPMailer/PHPMailer/releases/tag/v6.12.0

7.0.0 was released and includes the 6.11.x changes. https://github.com/PHPMailer/PHPMailer/releases/tag/v7.0.0

Steps to reproduce

Proposed resolution

Update version requirements.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

imclean created an issue. See original summary.

imclean’s picture

Version: 2.3.x-dev » 2.4.0
Status: Active » Fixed

Changes: https://git.drupalcode.org/project/phpmailer_smtp/-/commit/c0959d577699e...

No dev release in the dropdown, I'll sort that out another time.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

dadderley’s picture

Sorry, I am a bit lost here.

I am running Drupal core 10.5.4.
When I go to update, I get this:

mysite@az-drupal-01:/var/www/drupal$ composer require 'drupal/phpmailer_smtp:^2.4'
./composer.json has been updated
Running composer update drupal/phpmailer_smtp
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires phpmailer/phpmailer ~7.0, found phpmailer/phpmailer[v7.0.0] but the package is fixed to v6.12.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
    - Root composer.json requires drupal/phpmailer_smtp ^2.4 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0] but the package is fixed to v6.12.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 3
    - drupal/phpmailer_oauth2 is locked to version 1.0.0-alpha4 and an update of this package was not requested.
    - drupal/phpmailer_oauth2 1.0.0-alpha4 requires drupal/phpmailer_smtp ^2.1.0 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0] but the package is fixed to v6.12.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Please tell me how to successfully update.

imclean’s picture

It looks like you're using PHPMailer OAuth2, which hasn't been updated to run with later versions of PHPMailer SMTP. You'll need to wait for a new release, which should probably happen soon I guess. Just to maintain compatibility, no new features will be added my me.

dadderley’s picture

Thanks

imclean’s picture

PHPMailer OAuth2 2.0.0-alpha2 is out but untested. Composer may get itself in a loop, so try --with-all-dependencies.

imclean’s picture

Version: 2.4.0 » 2.4.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dadderley’s picture

Still does not work for me.
I am running Drupal core 10.5.6

mysite:/var/www/drupal$ composer require 'drupal/phpmailer_smtp:^2.4' -w
./composer.json has been updated
Running composer update drupal/phpmailer_smtp --with-dependencies
Loading composer repositories with package information
Dependency phpmailer/phpmailer is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/phpmailer_smtp ^2.4 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0] but it conflicts with your root composer.json require (~6.0).
  Problem 2
    - drupal/phpmailer_oauth2 is locked to version 2.0.0-alpha1 and an update of this package was not requested.
    - drupal/phpmailer_oauth2 2.0.0-alpha1 requires drupal/phpmailer_smtp ^2.1.0 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0] but it conflicts with your root composer.json require (~6.0).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
imclean’s picture

As the message says, try with a captital -W.

 -w, --update-with-dependencies                       Allows inherited dependencies to be updated, except those that are root requirements.
 -W, --update-with-all-dependencies                   Allows all inherited dependencies to be updated, including those that are root requirements.
dadderley’s picture

Hi.

I am still having this problem.
I have no idea how to resolve this.

mysite:/var/www/drupal$ composer require 'drupal/phpmailer_oauth2:^2.0@alpha' -W
./composer.json has been updated
Running composer update drupal/phpmailer_oauth2 --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package doctrine/annotations is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
Hardening vendor directory with .htaccess and web.config files.
49 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
No security vulnerability advisories found.
mysite:/var/www/drupal$ composer require 'drupal/phpmailer_smtp:^2.4' -W
./composer.json has been updated
Running composer update drupal/phpmailer_smtp --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/phpmailer_smtp ^2.4 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0, v7.0.1] but it conflicts with your root composer.json require (^6.0).
  Problem 2
    - drupal/phpmailer_oauth2 is locked to version 2.0.0-alpha1 and an update of this package was not requested.
    - drupal/phpmailer_oauth2 2.0.0-alpha1 requires drupal/phpmailer_smtp ^2.1.0 -> satisfiable by drupal/phpmailer_smtp[2.4.0].
    - drupal/phpmailer_smtp 2.4.0 requires phpmailer/phpmailer ^7.0.0 -> found phpmailer/phpmailer[v7.0.0, v7.0.1] but it conflicts with your root composer.json require (^6.0).


Installation failed, reverting ./composer.json and ./composer.lock to their original content.
mysite:/var/www/drupal$ vendor/bin/drush updb
 [error]  PHPMailer OAuth2 requires this module and version. Currently using PHPMailer
SMTP version
 (Currently using Unresolved dependency PHPMailer SMTP (Version >=2.4.0 required)
)

 ┌ Requirements check reports errors. Do you wish to continue? ─┐
 │ Yes                                                          │
 └──────────────────────────────────────────────────────────────┘

 [success] No pending updates.
mysite:/var/www/drupal$

Also, In the Status Report I see this:

Unresolved dependency
PHPMailer SMTP (Version >=2.4.0 required)
PHPMailer OAuth2 requires this module and version. Currently using PHPMailer SMTP version

As I say, I do not know how to resolve this.