Closed (fixed)
Project:
PHPMailer SMTP
Version:
8.x-1.4
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 May 2020 at 02:04 UTC
Updated:
6 Jan 2021 at 21:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sajosh commentedComment #3
imclean commentedHi @sajosh, thanks for your interest.
Composer is a very efficient tool for including external libraries and managing dependencies. As it is now the standard for Drupal, there are no plans to support other installation methods for this module.
You can try to hack something together yourself but it would be convoluted and hard to maintain.
Best practice would be to install composer on a local development environment, build the site locally then upload it to your shared hosting hosting platform.
Comment #4
mmjvb commentedThe best practice is to use Ludwig for situations not supporting Composer. That would require a ludwig.json specifying the requirements. You can produce one based on composer. Maybe there are alternatives to this module that are prepared to support it.
Comment #5
imclean commentedLudwig is an alternative. Useful, but not necessarily "best practice". I can look into it, however.
Maybe there are, nobody's forced to use any specific module. The aim here is to have a very lean, single focus module with some advanced config options.
I don't use Ludwig but I'm willing to accept a patch. If one isn't forthcoming I'll have a go at creating a ludwig.json but I'll need to understand its limitations.
Does it require an exact version of the library? Do I need to create a "libraries" sub folder? What else should I be aware of?
Comment #6
mmjvb commentedIm my opinion it is best practice for situations not supporting the use of Composer. It definitely beats manually messing with your installation to get things working. That might have worked for D7, but D8 being based on composer makes that a lot more difficult.
Glad to hear you are willing to look into supporting those that can't use Composer. Haven't found a lot of information on producing a ludwig.json. Suggest to use Composer to assist you in creating one. Make a project with drupal/core and then require your module. Produce the ludwig.json based on the packages installed by that require. The information you need can be found in the composer.lock for each package installed. Suggest to use the distribution url, not the source. The structure is a 'require' with a list of packages, for each package its version and url. Similar to the repository structure.
Obviously, the user must adjust the ludwig.json to his situation. Ludwig won't assist them doing dependency management like Composer does.The versions of packages used are determined at that moment in time. It is a given that things change in time. You might want to remind them about that in your README.
Comment #7
sajosh commentedYou two are awesome for being open minded to figuring this out.
I just got swiftmailer working without composer or ludwig but it's a hack ...
https://drupal-tools.web.cern.ch/docs/how/use-external-libraries
So I figured I could use the same hack for this module, phpmailer smtp. But alas it doesn't have phpmailer_required.php. Out of luck there.
So, I installed the Ludwig module but it requires a ludwig.json file. So i took a shot at below then put that file in the phpmailer_smtp folder. Then downloaded and placed the phpmailer library into the modules/phpmailer_smtp/lib folder.
No luck.
{
"require": {
"phpmailer_smtp/phpmailer": {
"version" : "v6.1.5",
"url": "https://github.com/PHPMailer/PHPMailer/archive/master.zip"
}
}
}
hhhmm
Comment #8
mmjvb commentedYour ludwig.json should be:
Comment #9
imclean commentedThe module itself doesn't need to be in
ludwig.json. Patch contains the below code. Please test and let me know if it works.Comment #10
sajosh commentedThank you both. imclean yours works nicely (#9).
Can't believe the 'v' in 'v6.1.5' is required, perhaps by the Ludwig module. Before imclean's version I was pulling my hair out trying to figure out which directory to put the extracted files into.
For anyone who wants to know the full steps too ...
1. install this phpmailer_smtp module and ludwig module
2. create and add the patch file from #9 or in a blank file copy the code in #9
3. put that file into /modules/phpmailer_smtp folder name it ludwig.json
4. download library at /admin/reports/packages (status should be 'missing')
5. put that file into /modules/phpmailer_smtp/lib/phpmailer-phpmailer/v6.1.5 (don't forget the v)
6. clear cache /admin/config/development/performance
7. check status is 'Installed' /admin/reports/packages
done
Right now i'm debugging why the views_send module isn't sending with phpmailer_smtp. But that's another post, this can be cloased, I think.
Comment #12
imclean commentedThanks @sajosh and @mmjvb. This is now in the dev version.
Comment #13
imclean commented#10
Make sure the "Formatter" in "Mail System" is set to something which can handle attachments, such as MIME Mail.
Comment #14
mmjvb commented@imclean Indeed my mistake, it is clearly documented only dependencies need to be required. Thanks for reporting.
@sajosh Thanks for confirmation and reporting the actions to be done.
Thanks for using and supporting Ludwig. With more than 5000 sites reporting that they are using Ludwig, consider it justified.
Comment #15
sajosh commentedThe problem was me testing with the test server in offline mode. The test emails had the url of the offline test server thus emails not sending or getting delivered.
imclean, your module is super simple to use and setup.
Of the four smtp's I tried (this, just_smtp, swiftmailer, and smtp authentication support), this one has no errors right out of the box, on Drupal 8.8.5. And yours is stable, current, and fewest bugs.
just_smtp kept striping these from emails causing spam score to go up
0.14 MISSING_MID Missing Message-Id: header
1.40 MISSING_DATE Missing Date: header
Plus this is a release candidate 1 for over a year so not stable.
smtp authentication support, also stripped message id and date.
Plus this is just so old and they are hacking in phpmailer v 6.1.5.
Swiftmailer, kept producing this in my emails causing spam score to go up
MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars
For both plain text and basic html.
Plus it strips out List-Unsubscribe header
Plus this has 76 open bugs while still in alpha2
mmjvb, you're right about ludwig. If composer is so awesome, it should be invisible.
Comment #16
khoebekeCan somebody make Ludwig work on phpmailer_smtp v 8.x-1.4 ?
Comment #17
sajosh commentedHi Khoebeke, Yes I tested it on v8.x-1.4, it works. Have you tried it?
Comment #18
sajosh commentedComment #19
mmjvb commentedIndeed, it should work for 8.x-1.4, however the ludwig.json needs to be created yourself. It is not part of that distribution.
Comment #20
imclean commentedThis is included in 8.x-1.5.
Comment #21
khoebeke@sajosh: I tried and it was succesfull!
Comment #22
devad commentedComment #23
jaims-dev commentedThanks a lot all, #10 (@sajosh) did it for me.
Only that for the current version (20201110, PHPMailer-6.1.7) I put the library files in modules/contrib/smtp/lib/phpmailer-phpmailer/^6.1.7
Comment #24
mmjvb commentedIt should be smtp/lib/phpmailer-phpmailer/6.1.7
depending on the value of version in ludwig.json, which should not be ^6.1.7 but either 6.1.7 or v6.1.7
Actually, the only requirement is that the value of version is a valid folder name. Obviously, it is convenient to put the correct version in there. However, that is not a requirement. It is only used to find the dependency and detect it is there. As long as that folder is mentioned in version, ludwig is happy.
Comment #25
beezer75 commentedI'm hoping someone on here can help, I previously had this module set up using Ludwig and phpmailer v6.1.5 - After upgrading the SMTP module to v8.x-1.0 Drupal doesn't recognize the phpmailer v6.1.5 library - I can update it via Ludwig at /admin/reports/packages but then I get the following error:
Fatal error: require(): Failed opening required '/code/modules/smtp/lib/phpmailer-phpmailer/v6.1.5/src/SMTP.php' (include_path='/code/vendor/pear/archive_tar:/code/vendor/pear/console_getopt:/code/vendor/pear/pear-core-minimal/src:/code/vendor/pear/pear_exception:.:/usr/share/pear:/usr/share/php') in /code/vendor/symfony/class-loader/ApcClassLoader.php on line 112
Thanks much in advance.
Comment #26
devad commented@Beezer75
Try to manually update SMTP module library dependancy in SMTP module ludwig.json file to "v6.1.7" as well.
Like this:
Please note that current "^" version prefix in SMTP module ludwig.json file could be problematic. It should be "v6.1.7" in both ludwig.json files.
And don't forget to rebuild caches after ludwig.json file is updated and again after all missing libraries are downloaded by Ludwig.
Comment #27
imclean commented@Beezer75, this is the issue queue for the PHPMailer SMTP module. It looks like your question belongs in the SMTP module issue queue.