PickBazar Documentation
WelcomeHow It Works
Prerequisite
Installation
Available Scripts & Command
How Can I use this app
Demo Deploy
Features
Settings
Payment
Flash Sale
Shop Transfer
Social LoginOTP (Mobile Number Verification)WalletEmail ConfigurationMailgun ConfigurationGmail SMTP ConfigurationMailtrap SMTP ConfigurationEmail VerificationSubscribeTerms and conditions
SEO and Analytics
Refund
Real-time Notification
Multilingual & Translation
Third-party Integrations
Deployment
API
Back-End Integration
Customizations
Update & Upgrade Guide
FAQ PageContactQuestion & AnswerFAQBreaking ChangesSupportChange Log

Email Configuration

A range of mail transport drivers are supported by Laravel and may be utilised for sending emails. We'll take you step-by-step through the setting of three (3) different email service types today. Here, we'll talk about setting up Mailgun, Gmail SMTP, and Mailtrap SMTP.

Mailgun Configuration

Sandbox domains are restricted to authorized recipients only. If you want to receive your email in sandbox account. Please authorize your email. Up to 5 Authorized Recipients can be added.

authorized-notice-image

For more information, Please follow Authorized Recipients

To setup and configure Mailgun you need to set these below .env keys. We will discuss how you can get those env variable from mailgun.

MAIL_MAILER=
MAIL_HOST=
MAILGUN_DOMAIN=
MAILGUN_SECRET=
MAIL_FROM_ADDRESS=
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
ADMIN_EMAIL=support@example.com
  • MAIL_MAILER=mailgun

  • MAIL_HOST=smtp.mailgun.org

  • To get MAILGUN_DOMAIN Create or SignIn a Mailgun account from here https://login.mailgun.com/login After login click sending you will see a domain list there. I will go with this domain below. Just copy this domain and set this as your MAILGUN_DOMAIN

    mailgun-domain-image

  • Now to obtain MAILGUN_SECRET click on on that domain. You will redirect to an over page like below click on API Keys.

    mailgun-api-key-image

    Then it will redirect to page find Mailgun API keys then click on Add new key

    mailgun-create-key-image mailgun-get-api-key-image

  • To set MAIL_FROM_ADDRESS just type your mail address.

  • Now go to the dashboard -> sending -> Domain Click on the domain then select SMTP. You will see

MAIL_PORT=587
MAIL_USERNAME=null

configuration information there like below.

overview-smtp-config-image

  • In a Mailgun configuration, you typically don't need to specify a MAIL_PASSWORD because Mailgun uses API keys for authentication, not SMTP passwords. You can set MAIL_PASSWORD=null or remove it from your .env file.

  • Set your MAIL_ENCRYPTION MAIL_ENCRYPTION=tls

  • You can set your admin email ADMIN_EMAIL=your_email@example.com

Gmail SMTP Configuration

To setup Gmail SMTP Configuration you need to set these below .env keys. We will discuss how you can get those env variable from Gmail.

MAIL_MAILER=
MAIL_HOST=
MAILGUN_DOMAIN=
MAILGUN_SECRET=
MAIL_FROM_ADDRESS=
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
ADMIN_EMAIL=support@example.com
  • MAIL_MAILER=smtp

  • MAIL_HOST=smtp.gmail.com

  • You can ignore MAILGUN_DOMAIN MAILGUN_SECRET for gmail.

  • To set MAIL_FROM_ADDRESS just type your mail address.

  • MAIL_PORT=587

  • To set MAIL_USERNAME=your@gmail.com just type your gmail address that you are using for configuration.

  • To get MAIL_PASSWORD from google Create or SignIn to a gmail account. Then go to your account or click the URL https://myaccount.google.com/security Then turn on 2-Step Verification.

    gmail-security-image

    Under 2-Step Verification settings you will see app passwords and click that -

    two-step-verification-image

    now set your application name under other (custom name)

    set-app-name-image

    after typing the name click on generate a propt will popup. like below That is your MAIL_PASSWORD copy that.

    generated-app-password-image

  • Set your MAIL_ENCRYPTION MAIL_ENCRYPTION=tls

  • You can set your admin email ADMIN_EMAIL=your_email@example.com

Mailtrap SMTP Configuration

In order to configure Mailtrap SMTP, you must specify the following .env keys. We'll go over how to get those environment variables using Mailtrap.

MAIL_MAILER=smtp
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=
MAIL_USERNAME=null
MAIL_PASSWORD=null
  • MAIL_MAILER=smtp
  • MAIL_HOST=ssandbox.smtp.mailtrap.io
  • To get MAIL_POR Create or SignIn a Mailtrap account from here https://mailtrap.io/signin. After login follow the following steps shown below to get the MAIL_PORT, MAIL_USERNAME & MAIL_PASSWORD.

Step 01: Project Creation.

Create a project to organize the emails into one central directory. Navigate to Inboxes from Email Testing and click on Add Project.

Add_Project

Insert a project name and click on the Add button to create a project sucessfully.

Project_Name

After creating a poject the Inboxes module will look something like this.

project_home

Step 02: Adding Inbox.

To create an Inbox, click on Add Inbox, Insert the inbox name and then click in the Save button.

Add_Inbox

After creating an inbox you'll have an interface that looks something like the image given below.

create_inbox

Step 03: Configure your Mailing Configuration.

You'll be redirected to the Email and SMTP Settings by clicking on the inbox that you've created. From there, select the integration to Laravel 9+.

SMTP

Now, with the default Laravel setup you can configure your mailing configuration by setting these values in the .env file in the root directory of your project. Click on the Copy button to copy the values.

Copy_env_values