OJS - Sending eMail Problem

Dear Colleagues;

Some host companies started to have a decision to close the function mail () of php for security reasons, after that OJS started to not to send emails to notify or even for forgot password issues. Unfortuanately host companies dont give support for OJS, and I am stucked… Changing host provider will be a big problem, but their suggestion is using PHPMailer as replacement of mail() function. OJS gives an oppurtunity to bypass that mail function issue by SMTP on in config.inc.php, however, it didnt worked for me…

For mediacritiques.net, how it can be solved, integrating PHPMailer (which is already uploaded to the server) to OJS and make it working that SMTP function?

Regards
Arif.

Settings of SMTP on config.inc.php as below:
[email]

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

; SMTP server settings
; smtp_server = mail.mediacritiques.net
; smtp_port = 25

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
; smtp_auth = PLAIN
; smtp_username = jmc@mediacritiques.net
; smtp_password = somepass
; 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 noreply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off

; Enable attachments in the various "Send Email" pages.
; (Disabling here will not disable attachments on features that
; require them, e.g. attachment-based reviews)
enable_attachments = On

; 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-priveleged user
max_recipients = 3

; 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

Hi @netieval,

You would need to remove the starting “;” from the settings you want to use – otherwise they’re commented out.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher;

Is that simple? Sorry for the inconvenience… Thanks. But I have a new issue like 365 mail delivery failed emails in my other email that I wanted a copy of the mail…

Regards
Arif.

Hi @netieval,

If you’re getting email delivery failures, they should contain details on why the messages were rejected.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher;

Sorry for my late response. I need a great help… As you said the messages contain the reason of rejection however, with my hosting provider, we can’t solve the cpanel issue that the messages deferred. Their suggestion is to split the users database into groups then send the notification emails.

I need help for how to integrate phpmailer (GitHub - PHPMailer/PHPMailer: The classic email sending library for PHP) into OJS to solve that kind of problem permanently?

Thanks in advance.
Regards
Arif.

Hi @netieval,

PHPMailer is already integrated into OJS. Is the problem that your server can’t send messages out to so many recipients at once, or something else?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher;

Something like that, mail()function is closed by hosting provider and I activated the SMTPMailer however when I use it to notify the users about the call for papers announcement, all the mails returning to journal’s email with this error: “Domain mediacritiques.net has exceeded the max defers and failures per hour (5/5 (%9)) allowed. Message discarded.”

For almost 15 days I couldnt send emails and struggling with hosting provider. Their suggestion was first you are your own and you can use phpmailer on your system which I don’t know howto integrate it to OJS which you are saying its already integrated so here the question; how can I activate it and start to use it succesfully without returning emails instead of SMTPMailer? Then, activating the SMTPmailer, hosting provider second suggestion to me after too many arguing, you split the users database into groups and send the emails one by one in a long time. I told them that config.inc.php settings of OJS already give that oppurtunity to send emails one by one and there is some time between two emails… And here I am…

I need to fix this email issue…

Thanks
Regards
Arif.

Hi @netieval,

PHPMailer isn’t integrated in current stable releases of OJS, but has been integrated into the master branch for release in OJS 3.0. See https://pkp.sfu.ca/bugzilla/show_bug.cgi?id=7980 for the bug entry and links to the code required to perform this integration. Unfortunately your use case is pretty specific so I’m not sure I can provide much detailed assistance – but another option would be to use another SMTP server that doesn’t have such stringent limits. See e.g. http://pkp.sfu.ca/wiki/index.php?title=Using_gmail_SMTP (but note that using Gmail as an SMTP service will cause all email to be sent “From” your account.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

That’s great news the new version will have phpmailer. Using gmail is not important and I already created a gmail account for the journal and edited the config.inc.php with the page you told, however here the question again why I can’t send emails? Do I need to change the principal contact email with that gmail.com account in the settings?

Regards
Arif.

Hi @netieval,

Gmail, in my experience, will automatically rewrite your messages with the sender set to your gmail account. As far as I’m aware, nothing else should be needed beyond the configuration changes suggested in the wiki link above.

Regards,
Alec Smecher
Public Knowledge Project Team

How to configure ojs with gmail SMTP. And send email to new registered user like Welcome mail?

Hi @ravi_kashhyap,

Did you try the link above in this thread?

Regards,
Alec Smecher
Public Knowledge Project Team

Dear Friends
I’m encountering the same problem for a week. We are running a journal on OJS. But the Emails are not being sent for some period of time. I have asked my host and server company and they say that everything is working. How can I fix the problem?

Are you using SMTP for sending email, or the native PHP configuration? (This is chosen in config.inc.php.)

How can I understand which setting we are using for the website?

Check your config.inc.php file, specifically the [Email] section:

If you have “smtp” set to “On”, whatever you have configured as your “smtp_server” and “smtp_port” will be in effect.

If “smtp” is commented out or turned “Off”, then OJS will be using your default PHP mail() function, which will in turn depend on your system configuration for mail relaying.

My emails wont pass at all with this setting

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

[email]

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

SMTP server settings
smtp_server = cpanel.freehosting.com
smtp_port = 465

; Enable SMTP authentication
; Supported mechanisms: ssl, tls
smtp_auth = ssl
smtp_username = contact@jmedsci.com
smtp_password = somepass

; 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 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 send non-editorial emails
; in seconds. This can be used to help prevent email relaying via OJS.
time_between_emails = 3600

Hi @adilhk,

I’ve already responded to your other post. Please don’t double-post; it clutters the forum.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi everybody

I am trying to use a shared host SMTP email for sending emails. Emails are sent successfully. However I have problem with bulk emails (for example announcements and new issue message). Because server does not let more than 30 emails per hour. Is there any way to process bulk emails in the config.php file? For example set email the maximum number of emails per hour, and time between emails sent for each time?