OJS 3xx Using SMTP don't send email__Help___

Dear all forum PKP,
I to reading SMTP don;t send email but I don’t using SMTP send 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 mechanisms: ssl, tls
; smtp_auth = ssl
; smtp_username = tckh.tvu@gmail.com
; smtp_password = ******

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
; allow_envelope_sender = Off

; Default envelope sender to use if none is specified elsewhere
; default_envelope_sender = tckh.tvu@gmail.com

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = on

; Amount of time required between attempts to nd 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-priveleged 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

Thanks All !!!

The semicolon in front of the lines indicates a comment. Since each of our smtp_ lines is commented, they are not currently in effect. Remove the semicolons from the start of lines that you want to be active.

Dear ctgraham,
Thanks for you help!
I remove the semicolons from the start of lines but OJS don’t send email.
Is there any way to check OJS for sending email?
Can you help me!
Thanks

Have you turned allow_envelope_sender “On”, and uncommented default_envelope_sender and force_default_envelope_sender?

When sending through Gmail, gmail will validate that the user OJS is claiming to be the sender. This means that if a user with an email address at yahoo.com sends a message via OJS, gmail will flag it as spoofed, and the recipient is likely to see it flagged as spam. (A technical explanation of SPF and DMARC is here.)

If a message is unable to be sent at all, you should see a warning flash in the notification area within OJS, and an error will be logged in the PHP error log.

Dear ctgraham,
Thanks for you help!
Thanks…

Dear Leader,
I chang code file config.inc.pkp but I don’t send gmail SMTP. Can you help me!
Thanks All !!!

—Code-----

[email]

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = smtp.gmail.com
smtp_port = 465

; Enable SMTP authentication
Supported mechanisms: ssl, tls
smtp_auth = ssl
smtp_username =tckh.tvu@gmail.com
smtp_password = ******

; 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 = tckh.tvu@gmail.com

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off

; Amount of time required between attempts to nd 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-priveleged 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

If email is truly not being sent at all, look in your PHP error log for details.

If email is being sent, but is being spamtrapped for failing SPF and DMARC rules, you will need additional configuration. In 3.1.1, you will need to have force_default_envelope_sender uncommented and turned on. In 3.1.2, you will need to have force_default_envelope_sender and force_dmarc_compliant_from uncommented and turned on.

Hello,
@nhuthua I have faced similar problem and solved the issue by putting the following code to the “config.inc.php” file. I have found 2 “config.inc.php” files to the directory, one outside the “public_html” folder and another inside “public_html” folder. I have put the following code to the both “config.inc.php” files.

; Use SMTP for sending mail instead of mail()
; smtp = On

; SMTP server settings
; smtp_server = smtp.gmail.com
; smtp_port = 465

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
; smtp_auth = ssl
; smtp_username = Username@gmail.com
; smtp_password = Password****

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
; allow_envelope_sender = Off

; Default envelope sender to use if none is specified elsewhere
; default_envelope_sender = my_address@my_host.com

Thanks Mr. Farhad_Hossain
I have copy to one outside "public_html’ and inside “public_html”. Send email no problem but check gmail “receive: no email”. Can you help me!
Thanks Very much
Nhut hua

Thank Leader,
I have force_default_envelope_sender: turned on
Send email no problem but check gmail “receive: no email”. Can you help me!
Thanks very much !!!

The only config.inc.php file which will be in use will live in your OJS root directory. This will be in your public_html directory or a subfolder.

Check your PHP error log to see if there are errors related to the sending of the email. Also check within Gmail’s spam folder to see if the message is being caught there. To diagnose this further, we will need to know whether the message is being sent but not received, or not sent at all.

Thanks Leader,
I do search many time file “PHP error log” but I did no find file “PHP error log”. Can you help me search file “PHP error log” OJS.
Thank you so much!:slightly_smiling_face:
Minh Nhut

The PHP error log can be directed to many different locations, based on your server configuration. Ask your system administrator or hosting provider for the location of the PHP error log on your server.

Daer Leader
Thank you very much, I search PHP error log on system hosting provider and error as picture.
I have code and download “PHPMailer new version” but don’t send SMTP
Can you help me adjust code error.
error
Minh Nhut :slightly_smiling_face:

In OJS 3.1 and later, you can turn on show_stacktrace in config.inc.php to capture more details to the PHP error log regarding an SMTP connect failure.

Try enabling that option and report the addition details.

Dear Leader,
I turn on show_stacktrace in config.inc.php. Over 3 days, I read PHP error log on system host (picture) . After that, I search PKP forum and edit error but I don’t send gmail SMTP.
error
Can you help me adjust code error.
Thank you very much!
Minh Nhut

This error message indicates that your server cannot connect to smtp.gmail.com using the protocol “ssl://” over port 465. This could be a server configuration issue, or a network configuration issue, or perhaps a different setting would give you access to Gmail.

You’ll want to check with your system administrator or hosting provider regarding your server and network configuration to ensure your server has outbound access to smtp.gmail.com.

See this thread for additional troubleshooting options:

Dear Leader,
I send gmail smtp: success. I change and edit code file config.inc.php as:

; 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 mechanisms: ssl, tls
smtp_auth = tls
smtp_username = username
smtp_password = password (at gmail 16 characters)

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On

Thank Leader very much!
Minh Nhut

1 Like

Hello. I’m new at this forum and in OJS. I’m having trouble with sending email, specifically with sending/receiving an email for password reset. I’m using OJS v. 3.1.2.0 on Windows Server 2008. I’ve set up SMTP settings:

;;;;;;;;;;;;;;;;;;
; Email Settings ;
;;;;;;;;;;;;;;;;;;

[email]

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = mail.arhiv.hr
smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
smtp_auth = ssl
smtp_username = REMOVED
smtp_password = REMOVED

; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = Off

; Default envelope sender to use if none is specified elsewhere
; default_envelope_sender = my_address@my_host.com

; 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 = Off

I’ve checked error_log, it says only: SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

I’m out of ideas, searched on this forum, tried so many solutions and nothing helped.
Has anyone got any idea, am I missing something?

Hello Slipsa,
I did’t send email SMTP but I was Leader share and I send emai SMTP: success.
I think you test gmail and file config.inc.php on OJS as follows:
Test gmail: setting gmail send by SMTP
Setting config.inc.php on OJS:
Ex:
; 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 mechanisms: ssl, tls
smtp_auth = tls
smtp_username = ***
smtp_password = ***

; 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 = ***

; Force the default envelope sender (if present)
; This is useful if setting up a site-wide noreply address
; The reply-to field will be set with the reply-to or from address.
force_default_envelope_sender = On

; Amount of time required between attempts to nd 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-priveleged 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
If don’t send gmail SMTP, you turn on “show_stacktrace” in config.inc.php more details to the PHP error log regarding an SMTP connect failed.
Thanks and good lucky!
Minh Nhut