Found a solution by myself,
For G suite Accounts, follow the bellow steps.
(Login to your admin console from, admin@yourdomin.com)
- Go to Admin console: https://admin.google.com/
- Go to Security
- Select 2-Step Verification:
- Select Higher Organizational unit:
- Allow users to turn on 2-Step Verification:
Now: (From your required mail id, i.e., journalmail@yourdomin.com)
- Go to Manage Accounts: https://myaccount.google.com/
- Go to Security (Left side bar)
- 2-Step Verification (redirects to login again) to Switch on
- Again login to Manage Accounts to Security.
- App Password (redirects to login again)
- Select App to Other(Custom Name)
- Name your app and click generate.
.
.
(It is not my app password, it is taken from google search.)
(It is not my app password, it is taken from google search.)
.
.
Now open config.inc.php from your file manager, change the settings.
[email]
; Use SMTP for sending mail instead of mail()
smtp = On
; SMTP server settings
smtp_server = smtp.gmail.com
smtp_port = 587
; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
smtp_auth = tls
smtp_username = journalmail@yourdomin.com
smtp_password = ******* (app password)
Enjoy Sending Mail