--------------------------------------------
UPDATE: It won't work after Sep 2024
This method won't work at the end of this September. Why? Check these pages:
https://support.google.com/accounts/answer/6010255
https://workspaceupdates.googleblog.com/2023/09/winding-down-google-sync-and-less-secure-apps-support.html
Alternative? papercut from ChangemakerStudios and docker
If you are using docker for your development environment, you are my good friend and I like you, otherwise, I have no idea what to do. Find your way. I promise with docker it's gonna be too easy that you can't believe it.
-
Add `papercut` as a new service to your `docker-compose.yml` file.
# Other configurations # ... # ... # ... services: #other services # ... # ... # ... papercut: image: changemakerstudiosus/papercut-smtp:latest ports: - 10300:80 # choose any port you like, for me `localhost:10300` would be the port to access the papercut web application - 25:25
- Run or restart your containers to have the new service added to the same network.
-
Setup SMTP configuration in Prestashop backoffice like this image
- Set the method as "Set my own SMTP ...".
- Set the SMTP server to "papercut" which is the name of the service or container, and it's accessible with that name in the network of containers.
- Leave the email domain, username, and password fields empty.
- Set encryption to none and the port to 25. This number comes from the docker-compose file, you can change it if you need.
- Now try sending an email by triggers like account creation order status change or use of the Mail::send() method, here's a demo:
Thanks to this amazing repository on Github: https://github.com/ChangemakerStudios/Papercut-SMTP
----------------------------------------------------------------------------
How to test email functions with a Gmail account in Prestashop?
Hi community.
I have seen some questions about the email issues. I want to show you how to set up a Gmail account in Prestashop as your temporary SMTP server, which lets you easily test your email functionality, templates and related stuff.
This is what I went through in a local server and I manged to get it working.
- Set up a new Gmail account (if you do not have any).
- Sign in to your account.
- Open BO of your Prestashop.
- Go under this menu "Advanced Parameters > E-mail".
- Find the "Email" form.
-
Fill the form like this:
- Send emails to > Select "Customer Service"
- Radio Buttons > Select "Set my own SMTP parameters (for advanced users ONLY)"
- Email domain name > Let it be blank
- SMTP server > "smtp.gmail.com"
- SMTP username > Fill it with your gmail for example : [email protected]
- SMTP password > Fill it with the account password (if does not work create an APP password and use that)
- Encryption > Select "TLS"
- Port > "578"
- Radio Buttons > Select "Both"
- Log emails > Select "Yes"
After you have saved these, send a test email in the next form with title of "Test your email configuration".
I have added a video for you to follow the steps. It very easy.
I use this method just for testing, like when you want to test the email templates and you do not want to put time on setting up an SMTP server locally. I do not recommend using this in a production shop.