jfoucher / mailocal
Debug your emails while making sure real customers never see them.
Installs: 1 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 71
Watchers: 3
Forks: 11
Open Issues: 21
Type:project
Requires
- php: ^7.3
- ext-ctype: *
- ext-iconv: *
- html2text/html2text: ^4.2
- jfoucher/email-parser: 0.4.*
- kevinpapst/adminlte-bundle: ^2.0
- react/socket: ^1.2
- sensio/framework-extra-bundle: ^5.1
- symfony/asset: 4.2.*
- symfony/console: 4.2.*
- symfony/dotenv: 4.2.*
- symfony/expression-language: 4.2.*
- symfony/flex: ^1.1
- symfony/form: 4.2.*
- symfony/framework-bundle: 4.2.*
- symfony/monolog-bundle: ^3.1
- symfony/orm-pack: ^1.0
- symfony/process: 4.2.*
- symfony/security-bundle: 4.2.*
- symfony/serializer-pack: *
- symfony/swiftmailer-bundle: ^3.1
- symfony/translation: 4.2.*
- symfony/twig-bundle: 4.2.*
- symfony/validator: 4.2.*
- symfony/web-link: 4.2.*
- symfony/yaml: 4.2.*
- twig/extensions: ^1.5
Requires (Dev)
- phpstan/phpstan: ^0.11.2
- symfony/debug-pack: *
- symfony/maker-bundle: ^1.11
- symfony/profiler-pack: *
- symfony/test-pack: *
- symfony/web-server-bundle: 4.2.*
Conflicts
- dev-master
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3
- v0.2
- v0.1
- dev-dependabot/npm_and_yarn/minimist-1.2.8
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/json5-and-symfony/webpack-encore-and-sass-loader-2.2.3
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-and-symfony/webpack-encore-1.4.2
- dev-dependabot/composer/twig/twig-2.15.3
- dev-dependabot/npm_and_yarn/terser-4.8.1
- dev-dependabot/npm_and_yarn/jquery-ui-1.13.2
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/npm_and_yarn/shell-quote-1.7.3
- dev-dependabot/npm_and_yarn/eventsource-1.1.1
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-feature/symfony6
- dev-feature/self-contained
This package is auto-updated.
Last update: 2023-09-29 11:51:39 UTC
README
Mailocal
Safely test sending your emails by using this local SMTP server and viewing the results on the web interface.
By using this locally installed SMTP server you can be sure that your real customers will never see your test emails!
However you can see all of them by simply opening the provided interface in any browser.
Screenshots
Requirements
- php 7.3
- ext-curl (php7.2-curl)
- ext-mbstring (php7.2-mbstring)
- ext-sqlite3 (php7.2-sqlite3)
- ext-xml (php7.2-xml)
- ext-zip (php7.2-zip)
- composer
If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command:
curl -s http://getcomposer.org/installer | php
Install
composer create-project jfoucher/mailocal
- That's it
Running
cd mailocal
to enter the directory just created by composer- Run
bin/mailocal
to run both the SMTP server and the web server
Alternatively you can:
- Run
yarn run build
to build the frontend assets php bin/console email:server
to launch the SMTP serverphp bin/console server:start
to start Symfony's built-in web server
Configuration
- Configure your other apps to use this new local SMTP server:
- host:
127.0.0.1
- port:
2525
(or the one you chose, see below) - You can configure a SMTP username and password by setting the
SMTP_SERVER_USER
andSMTP_SERVER_PASSWORD
fields in your.env
file. Make sure you update your email client's credentials accordingly.
- host:
- Mailocal uses an SQLite database by default (in
var/data.db
) but you can choose to use any other database by setting the correct URL in the.env
file. - By default,
bin/mailocal
will start a web server that listens on 127.0.0.1 (address) and the first free port starting from 8000. This is where you can view any emails you receive. You can forcebin/mailocal
to always listen on a specific address/port by setting the value ofWEB_SERVER_ADDRESSPORT
in your.env
file. The value can be address:port, address, or port.
Done
You can now view any emails you receive by opening http://127.0.0.1:8000 in your browser
The SMTP runs on port 2525 by default. Pass the --port
option to use another one, like this: php bin/console email:server --port=587
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Warning
Never use this in production, only run it on your local machine.