How to Configure the email on NexoPOS 4.x

NexoPOS 4.x doesn't come with the email configured. We rather don't like it to depends on the default PHP mail function, which we believe has a low rate of successful delivery. As NexoPOS 4.x is built on Laravel, there are many solutions you can use to enable the email, and that's what we'll find out.

# Configuring Mailgun with NexoPOS 4.x

Mailgun is a freemium email service that offers a better delivery rate for NexoPOS 4.x. You can get started at no cost and have NexoPOS sending emails. Once you've created your account, you need to log in to your dashboard. You might be invited to verify your account, that will require you to add some record to your DNS.

Note that if you have subscribed for extended support, we can help you to configure this.

Once you're done, you'll need to register a domain that will be sending the email.

Now, we need to retrieve your private API key. You can find that on your account settings.

You'll then need to edit your .env file using "nano" if you're accessing it from the command line or from your file manager. The .env file is a sensitive file that has a configuration of the application. Before editing, you should make a backup.

cp .env .env-backup

Once it's done, open it and create the following key-value pair (you can search for it to see if those key-value pairs have been previously added).

MAIL_MAILER=mailgun
MAILGUN_DOMAIN=[your domain on mailgun]
MAILGUN_SECRET=key-******************** 

Note that here, you need to replace the "MAILGUN_SECRET" with the secret you have copied earlier. You should also make sure the MAIL_MAILER is set to "mailgun".

# Configuring the SMTP service (example with mailgun)

Mailgun can also be used as an "SMTP" solution. You'll need to access your domain settings to retrieve all the required information.

From now you'll need to update the .env file to be as follow :

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=********
MAIL_PASSWORD=********
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="${APP_NAME}"

Fill in the username and password as you have created on the SMTP credentials. If you haven't created any SMTP users yes, you can proceed by clicking on "Add new SMTP user".

You're not forced to use Mailgun, you can the following free SMTP services.

Don't forget if you have an issue during the configuration, please let us know.