Email Configuration with Gsuite

Hai,
I am trying to configure all the methods in Email settings in OJS 3- config.inc.php, nothing works me.
I got my refresh token from Google Developers OAuth 2.0 Playground,
This is my settings, please help me.

;;;;;;;;;;;;;;;;;;

; Email Settings ;

;;;;;;;;;;;;;;;;;;

[email]

; Use SMTP for sending mail instead of mail()

smtp = On

; SMTP server settings

smtp_server = smtp-relay.gmail.com

smtp_port = 587

; Enable SMTP authentication

; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)

smtp_auth = tls

smtp_username = shareit@joinjet.org

smtp_password = ********

;

; Supported smtp_authtype: RAM-MD5, LOGIN, PLAIN, XOAUTH2 (see PHPMailer AuthType)

; (Leave blank to try them in that order)

smtp_authtype = XOAUTH2

; The following are required for smtp_authtype = XOAUTH2 (e.g. GMail OAuth)

; (See Using Gmail with XOAUTH2 · PHPMailer/PHPMailer Wiki · GitHub)

smtp_oauth_provider = Google

smtp_oauth_email = shareit@joinjet.org

smtp_oauth_clientid = 964700382985-4c0oud99qe0itkfghl2bne0uok96nosi.apps.googleusercontent.com

smtp_oauth_clientsecret = LdejyJHREtGap*************

smtp_oauth_refreshtoken = 1//04WcgCzLK6qfECgYIARAAGAQSNwF-L9Irfx3ulSsHKRiMTeY-***************

; Enable suppressing verification of SMTP certificate in PHPMailer

; Note: this is not recommended per PHPMailer documentation

; smtp_suppress_cert_check = On

; Allow envelope sender to be specified

; (may not be possible with some server configurations)

allow_envelope_sender = On

; Default envelope sender to use if none is specified elsewhere

default_envelope_sender = shareit@joinjet.org

; Force the default envelope sender (if present)

; This is useful if setting up a site-wide no-reply address

; The reply-to field will be set with the reply-to or from address.

force_default_envelope_sender = On

; Force a DMARC compliant from header (RFC5322.From)

; If any of your users have email addresses in domains not under your control

; you may need to set this to be compliant with DMARC policies published by

; those 3rd party domains.

; Setting this will move the users address into the reply-to field and the

; from field wil be rewritten with the default_envelope_sender.

; To use this you must set force_default_enveloper_sender = On and

; default_envelope_sender must be set to a valid address in a domain you own.

force_dmarc_compliant_from = On

; The display name to use with a DMARC compliant from header

; By default the DMARC compliant from will have an empty name but this can

; be changed by adding a text here.

; You can use ‘%n’ to insert the users name from the original from header

; and ‘%s’ to insert the localized sitename.

; dmarc_compliant_from_displayname = ‘%n via %s’

; Amount of time required between attempts to send non-editorial emails

; in seconds. This can be used to help prevent email relaying via OJS.

time_between_emails = 3600

; Maximum number of recipients that can be included in a single email

; (either as To:, Cc:, or Bcc: addresses) for a non-privileged user

max_recipients = 10

; If enabled, email addresses must be validated before login is possible.

require_validation = Off

; Maximum number of days before an unvalidated account expires and is deleted

validation_timeout = 14

When you attempt use Gmail as your SMTP sender it is required that you grant access to your web app in Gmail service. Have you done it already?

It is likely that in your Gmail account provided as sender you received some Gmail warnings about granting this privilege. Please take a look and proceed with their instructions to do so.

Thank you!

I didn’t receive any one like that.,

Only it shows, critical security alert. (I reviews it as me)

But, I am using Gsuite for Education.

My mail I’d is : shareit@joinjet.org

I have created an Gmail API app, from my google cloud console.

& I get credentials, as I mentioned above.

I am not good at codes. I can understand basic level programs, please guide me step by step.

Screenshot_2021-07-04-22-50-50-209_com.google.android.gm

Found a solution by myself,

For G suite Accounts, follow the bellow steps.

(Login to your admin console from, admin@yourdomin.com)

  1. Go to Admin console: https://admin.google.com/
  2. Go to Security
  3. Select 2-Step Verification:
  4. Select Higher Organizational unit:
  5. Allow users to turn on 2-Step Verification:

Now: (From your required mail id, i.e., journalmail@yourdomin.com)

  1. Go to Manage Accounts: https://myaccount.google.com/
  2. Go to Security (Left side bar)
  3. 2-Step Verification (redirects to login again) to Switch on
  4. Again login to Manage Accounts to Security.
  5. App Password (redirects to login again)
  6. Select App to Other(Custom Name)
  7. Name your app and click generate.
    .
    .
    (It is not my app password, it is taken from google search.)
    image
    (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

@Shareit_Journal I think you should blur your app password, or generate a new one.

It is not my app password, it is taken from google search.

I understand. It is perfect then! :slight_smile:

This topic was automatically closed after 4 days. New replies are no longer allowed.