Jump to content
inweb

[Free Module] Swift Mailer 5 For Prestashop 1.3/1.4/1.5/1.6 (Ps 1.6.1.6 Compatible)

Recommended Posts

Moderators: we've originally posted this thread in the Paid modules section and IT WAS MOVED BY MODERATORS into the Free modules section and it is currently approved by the community manager. If you think this thread does not belong here, then talk with the community manager (we have no problem to move the thread back into the Paid modules section). Thank you.

 

We made a completely free Swift Mailer 5 support for PrestaShop 1.3/1.4/1.5/1.6!

  • What is Swift Mailer?
    It is a powerful feature-rich PHP Mailer.
  • Why do I need to install this module?
    PrestaShop 1.3/1.4/1.5/1.6 comes with Swift Mailer 3.3.2 released in 2007 that does not support the newest standards and provides only the moderate rate of deliverability. Swift Mailer module adds support of the newest and greatest Swift Mailer 5.x to your PrestaShop!

If you are taking seriously sending newsletters, this module is a must! :-)

Features - Swift Mailer Module

  • Features the Swift Mailer 5.x support for PrestaShop
    Flexible and elegant approach to sending emails with a multitude of features.
  • Features support of all SMTP Relay Services
    Supports the newest SSL/TLS industry standards.
  • Features support of Embedding the Inline Media Files
    Your store logo will be built-in in PrestaShop emails (not as standard attachment).
  • Adds a Message-ID header to all emails
    Significantly increases the rate of deliverability of all emails that are sent to your customers (this especially applies to PrestaShop 1.3/1.4).
  • Features all-in-one Mail.php class file
    If you upgrade your PrestaShop to a different version, everything keeps working (the re-installation of the module may be required in certain cases).
  • Features One-click installer
    You will only need to upload the module and follow the on-screen instructions.

Requirements

  • PrestaShop 1.3.x.x/1.4.x.x/1.5.x.x/1.6.x.x
  • PHP 5 and later versions (Safe Mode is supported)

Download

FAQ

  • Is this module perfectly working with the recent PrestaShop 1.6 versions?
    Yes.
  • Is this module working fine with older PrestaShop versions such as 1.3, 1.4 or 1.5?
    Yes. It was tested with these PrestaShop versions as well.
  • Why does this module do not use overrides?
    PS Mail.php file includes hard-coded references to Swift3 files. It would not work.
  • I tried to make Swift Mailer 5 work with PrestaShop 1.3/1.4 by myself but it is impossible due to class loading issue. Does this module resolve this issue?
    Yes. This module gets rid of __autoload() function on the fly and makes class loading spl compatible (no need to edit any files).
  • I've installed the module but it says "Swift Mailer 5.x is missing. Please download Swift Mailer 5.4.x and copy sw..."
    By installing the module you've added Swift Mailer 5.4.x support to your PrestaShop. Now you need to download the Swift Mailer library (click the link that points to github.com in the message and then follow the instructions).

Our other FREE modules

Edited by inweb (see edit history)
  • Like 4

Share this post


Link to post
Share on other sites

Does the module tell you "Swift is up and running!" when you click the Configure button of the module at the PS BackOffice? Or do you mean you did not receive your Download link?

Edited by inweb (see edit history)

Share this post


Link to post
Share on other sites

I've reviewed post and existing rules about attach/not-attach zip file.  I am going to allow this post as original poster has 100+ posts, is an active and positive community member.

 

If you have issue with this or any post, please use the report link located on every post.  Thanks

Share this post


Link to post
Share on other sites

A new update of the Swift Mailer 5 for PrestaShop module has been released!

Swift Mailer 5 for PrestaShop 5.0.01

  • Small improvements

One more good news: PrestaShop 1.6.1.5 comes with new Swift Mailer :-) It looks like as Swift Mailer 5.2.2 (Swift::VERSION constant is not set).

There are two things you need to know:

  • The PrestaShop 1.6.1.5 contains a backward incompatible change: Mail::generateId() method now returns a different value than older releases (may only cause troubles in a highly unlikely event to 3rd party modules that use this method along with Mail class).
  • All versions of this module are compatible with PS 1.3/1.4/1.5/1.6 including the recent 1.6.1.5.
  • Mail::generateId() method of this module now returns a correct value depending on the PrestaShop version.
  • This module supports Swift Mailer up to 5.4 branch (needs to be placed in tools/swift5 directory so it does not break the compatibility with any of the PS versions).

Have a nice weekend everyone!

Share this post


Link to post
Share on other sites

A new update of the Swift Mailer 5 for PrestaShop module has been released!

 

Swift Mailer 5 for PrestaShop 5.0.02

  • BackOffice-wide warning message if the module is not configured was added
Also Swift Mailer (the standalone PHP library used by this module) has been updated to 5.4.2.

 

Swift Mailer library 5.4.2:

  • fixed support for IPv6 sockets
  • added auto-retry when sending messages from the memory spool
  • fixed consecutive read calls in Swift_ByteStream_FileByteStream
  • added support for iso-8859-15 encoding
  • fixed PHP mail extra params on missing reversePath
  • added methods to set custom stream context options
  • fixed charset changes in QpContentEncoderProxy
  • added return-path header to the ignoredHeaders list of DKIMSigner
  • fixed crlf for subject using mail
  • fixed add soft line break only when necessary
  • fixed escaping command-line args to Sendmail
Don't forget to upgrade the library as well (by uploading it to the public_html/tools/swift5/ directory) :-)

Share this post


Link to post
Share on other sites

Don't rename the current "public_html/tools/swift/" directory to "public_html/tools/swift5/" (it will not work). Please see our previous post for how to make it work.

Share this post


Link to post
Share on other sites

I got a problem

I have seen only module but i don't know that how use swiftmail.

Uninstall module then delete.

Try to upload again, upload successful but not seen module list.

its empty.

Plz help!

 

note: file directory not deleted.

Share this post


Link to post
Share on other sites

I got a problem

I have seen only module but i don't know that how use swiftmail.

Uninstall module then delete.

Try to upload again, upload successful but not seen module list.

its empty.

Plz help!

 

note: file directory not deleted.

 

 

I just went through the install process.  I installed the module by uploading the zip file via Modules page.  After you install the module you have to place the additional files the module specifies in Tools/Swift5

 

Everything is working for me now except I still get warnings saying an email didn't go through...although it actually did.

Share this post


Link to post
Share on other sites

Hello,

I tried to use your module with no success on PS 1.4.9. Here was my experience along with a few recommendations.

- First of all, my advice is to include the working version of Swift with your module. The module won't work at all right out of the box, and discovering after installation that you have to download a package from github, get part of it and upload stuff into the tools folder, create the new folder swift5 is confusing and impractical.

- Second, the copy I got from github didn't work at all (perhaps they have updated after you have first tested the module with it?). I uploaded the content of the "lib" folder of the package, the file swift_required.php was where expected but the __DIR__ constant in it wasn't parsed at all by my provider's php (I am on HostGator). So I had to try to fix it manually.

- After fixing by hand swift_required.php and replacing __DIR__ with dirname(__FILE__) the swift library could at least be loaded by Swift5 module so apparently it was installed and running correctly (green tick)

 

- Went to the backoffice -> preferences -> email dialog, configured smtp section, the test button did throw a "class not found" error for Swift_SmtpTransport.
So, not working, still.

- Tried to uninstall and another bad surprise: the module had patched the classes/Mail.php file so I had to revert it by hand (did it made a backup? No).

 

- By pure chance I had kept a backup of that file and so I could restore it. The instruction manual coming with the module did not mention anything about uninstall, so I was able to restore initial situation just because I was lucky. The casual user would have left with a shop unable to send mail.

Please, be aware that this software is not well packaged.

Free software is welcome and we users of course are prepared to face difficulties, but a little better packaged solution would have really meant good value, and a much better publicity for the distributing site.

 

If there are updates, I will be happy to test them on PS 1.4

 

Share this post


Link to post
Share on other sites

- First of all, my advice is to include the working version of Swift with your module. The module won't work at all right out of the box, and discovering after installation that you have to download a package from github, get part of it and upload stuff into the tools folder, create the new folder swift5 is confusing and impractical.

This never happen - the point of the module is a wrapper for using any Swift Mailer library 5.x

 

- Second, the copy I got from github didn't work at all (perhaps they have updated after you have first tested the module with it?). I uploaded the content of the "lib" folder of the package, the file swift_required.php was where expected but the __DIR__ constant in it wasn't parsed at all by my provider's php (I am on HostGator). So I had to try to fix it manually.

 

- After fixing by hand swift_required.php and replacing __DIR__ with dirname(__FILE__) the swift library could at least be loaded by Swift5 module so apparently it was installed and running correctly (green tick)

 

- Went to the backoffice -> preferences -> email dialog, configured smtp section, the test button did throw a "class not found" error for Swift_SmtpTransport.

So, not working, still.

There is nothing to fix - everything works out of the box and it includes the latest version of the Swift Mailer library (we deploy this module on around a dozen websites per week - it includes Hostgator)

 

- Tried to uninstall and another bad surprise: the module had patched the classes/Mail.php file so I had to revert it by hand (did it made a backup? No).

Have you read the FAQ at the first post of this thread? Yes it DOES replace (with a backup) the original Mail class because the original Mail.php file includes a hard-coded references to Swift3 files.

 

- By pure chance I had kept a backup of that file and so I could restore it. The instruction manual coming with the module did not mention anything about uninstall, so I was able to restore initial situation just because I was lucky. The casual user would have left with a shop unable to send mail.

The backup file is created automatically in the same directory where the original Mail.php class resides (the file is named e.g. Mail.php_2016-21-16_08-44-46).

 

This module is does packaged well and there is already around few hundreds happy users :) We assume you are new to PS - we would suggest you to make reviews of modules when you gain some more experience.

 

Merry Christmas everyone.

Share this post


Link to post
Share on other sites

Hello,

 

I uploaded all the files needed, but when I try to send a test mail I'm getting the following message:

 

Error: check your e-mail settings

 

Before it was the fsockopen error...

 

Also, no the contact form is giving me an error 500 message after trying to send a contact form message...

 

Any clue?

 

My SMTP settings worked flawlessly untill a few weeks, my webhoster and mailhoster didn't change anything when I asked them...

 

So my mailsettings should be working...

 

Let me know if you can help me out...

 

Thanks,

 

Marco

Share this post


Link to post
Share on other sites
On 2/12/2018 at 11:58 AM, julieKaiman said:

hi

i want to download this module but i don't know how can i do this

Follow the download link in the original posting?

Share this post


Link to post
Share on other sites

Yes, users need to follow the download link and make an order. A soon as it is validated (less than 10 minutes), download link si sent to the email.

Share this post


Link to post
Share on other sites

Hello,

I downloaded and installed the plugin. I donwloaded the swiftmailer-5.4.12.zip from https://github.com/swiftmailer/swiftmailer/releases as suggested.

I created an empty directory "tools/swift5" and copied into it the contents of the swiftmailer-5.4.12 lib folder

The plugin configuration page tells me:
Swift Mailer is up and running! Swift Mailer 5 for PrestaShop 5.0.02

Unfortunately, when I send a test mail I get this error message:
Fatal error: Class 'Swift_SmtpTransport' not found in /prestashop/classes/Mail.php on line 552

Prestashop versione 1.6.1.4

Any suggestions?

 

Share this post


Link to post
Share on other sites

Please delete /cache/class_index.php file. It should resolve the issue you are having.

Share this post


Link to post
Share on other sites

Unfortunately I had already tried to delete the file /cache/class_index.php file and the problem persisted. I wrote you this message because I had already tried practically all the solutions but without success

The thing is really very strange.

Share this post


Link to post
Share on other sites

I found the problem. I hadn't noticed that it was an override of the Mail class that made your changes incompatible. I made a merge of the two classes and now everything is ok.

Thanks inweb for the time you spent with me

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More