Email Configuration
By default, the system is set up to log all emails into files. You have to configure this setting to send emails. You may use any of these supported services: smtp
, sendmail
, mailgun
, mandrill
and sparkpost
. To configure email, open the .env
file and update these keys with your values.
. MAIL_MAILER=log MAIL_HOST=smtp.example.com MAIL_PORT=587 MAIL_USERNAME=user MAIL_PASSWORD=secret MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=no-reply@example.com MAIL_FROM_NAME=No-Reply MAIL_REPLY_TO_ADDRESS=reply@example.com MAIL_REPLY_TO_NAME=Reply . .
The MAIL_FROM_ADDRESS
and MAIL_FROM_NAME
will be used to send an email by your marketplace where no specific sender information is available to use.
Warning! The system will generate errors if the mail fails. So double-check the email configuration. Talk to your email/hosting service provider if you’re not sure what to do. They will provide you with the right values, you just need to place them in the env file.
Testing Emails
If you don’t have a mail server or just testing the application you can fake the actual sending of emails. zCart has a log
driver and the Mailtrap
driver for this job.
Log Driver
Instead of sending your emails, the log mail driver will write all email messages to your log files for inspection. All emails will be stored in storage/logs/zCart-date.log
files. The default email driver is log
, so you don’t have to do anything to configure this driver.
Mailtrap
Finally, you may use a service like Mailtrap and the smtp
driver to send your email messages to a “dummy” mailbox where you may view them in a true email client. This approach has the benefit of allowing you to actually inspect the final emails in Mailtrap’s message viewer.