# Mail Settings

**Login To Admin ->  Project Settings -> Mail Settings**&#x20;

{% hint style="danger" %}
In Mail Detail Section Enter the name with no spaces. There are three Mail Drivers: SMTP, Mail, Sendmail, if SMTP is not working then check Sendmail.
{% endhint %}

There are three Mail Drivers: SMTP, Mail, Sendmail, if SMTP is not working then check Sendmail.

An email driver is a software component that allows applications to send and receive email messages. It acts as an interface between the application and the email server, and allows the application to communicate with the server using a standard protocol such as SMTP (Simple Mail Transfer Protocol) or IMAP (Internet Message Access Protocol).

Email drivers are commonly used to send automated email notifications, send emails, confirmation emails or password reset emails to users.

**SMTP** (Simple Mail Transfer Protocol) is a protocol for sending email messages between servers. Most email systems that send mail over the Internet use SMTP to send messages from one server to another.\
**Sendmail**: The Sendmail driver uses the `sendmail` command-line tool installed on your server to send emails. It works well on most Unix-based systems without requiring additional configuration.

{% hint style="danger" %}
**Note :** If showing an <mark style="color:red;">**error 500**</mark> in reset password, New User Registration and Payment Gateways then must check your mail setting. Reset password, New User Registration , and Payment Gateways error show due to you forget to add mail details or wrong mail details in mail setting or .env file. also check error via debug true:&#x20;
{% endhint %}

## **Gmail SMTP Settings:** <a href="#gmail-settings" id="gmail-settings"></a>

* SMTP username: Your Gmail address.
* SMTP password: Your Gmail password. If Using Gmail then Use App Password. [Process of App Password](https://support.google.com/accounts/answer/185833?hl=en)
* SMTP server address: smtp.gmail.com.
* Gmail SMTP port (TLS): 587.
* SMTP port (SSL): 465.
* SMTP TLS/SSL required: yes.

1. #### To Setting up Gmail 2 Step Verification must be enabled on your Gmail account if not then enable it from [https://myaccount.google.com](https://myaccou) and visit security tab to enable it.
2. Once you enabled the 2 step verification on your account under security tab visit App password section as shown below.

<figure><img src="https://851821020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkfxdGRqNrOvTfSSLq2F%2Fuploads%2Fc4KRm0RvkScTWQ7Y0Yeq%2Fimage.png?alt=media&#x26;token=a596ca6b-e318-4f9f-b608-c9bd68aeef33" alt=""><figcaption></figcaption></figure>

&#x20;3\. Click on App passwords to create new app and it will ask you for sign in again, Sign in again to continue. Once you signed in you will see a new app creation window.

<figure><img src="https://851821020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkfxdGRqNrOvTfSSLq2F%2Fuploads%2FRZtlCbY3C5Ke1siYYU6J%2Fimage.png?alt=media&#x26;token=962c44e0-1cbe-4cf9-9b7f-155ed93ac4bf" alt=""><figcaption></figcaption></figure>

4\. Click on select app option and choose **Other (custom name)** option. Enter the App name example : **Quizly signin** and click on generate button.

<figure><img src="https://851821020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkfxdGRqNrOvTfSSLq2F%2Fuploads%2Foc8glYTQHYe6JSRZnHxW%2Fimage.png?alt=media&#x26;token=8f9d5839-2ed2-4a34-9eaa-8c0988e2add5" alt=""><figcaption></figcaption></figure>

5\. Once done ! you will successfully see a popup with password copy that password and back to Quizly admin panel and visit Site Settings -> Settings -> Mail settings.

6\. Put following settings in your mail settings

{% hint style="info" %}
Mail driver : sendmail \
Mail port : 465 \
Mail username : your gmail username or email address\
Mail password : App password which you copied above. \
Mail Encryption : TLS
{% endhint %}

7.To test the mail is working on not use forget password feature and if mail not received kindly check spam folder too.

{% hint style="danger" %}
If you're receiving emails or spam folder then probably your email address is used in some phishing activities. To resolve it kindly contact mail provider, its not script issue..
{% endhint %}

{% hint style="danger" %} <mark style="color:red;">**The Web Site Just Showing a Blank White Page**</mark>\
Blank white screen due to you give space in app name and mail from the name. Go to .env file and remove space and special characters in the app name and mail from the name.
{% endhint %}

**to change directly in .env file -> Open and edit `.env` file.**\
Locate the `.env` File: The `.env` file is located in the root directory of your Laravel project. Use a text editor to open the file.

```
MAIL_DRIVER=smtp (some times support sendmail)
MAIL_HOST=mail.yourdoamin.com (For Gmail = smtp.gmail.com)
MAIL_PORT=2525  (For Gmail = 465)
MAIL_USERNAME=your_emailid
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=null  (For Gmail = ssl)
```
