Skip to main content

Email Configuration

Hosting tip

Most hosting services will provide a configured email server. If you are unsure, contact your hosting provider to learn what they can offer.

This section describes the requirements for a properly configured email server and discusses the configuration options for sending email with OJS.

SPFโ€‹

Your domain must be configured according to the SPF protocol. To comply with this protocol, your domain's DNS zone must include an appropriate TXT record. For example, if the application is hosted at https://my-journals.com, the domain my-journals.com must have a TXT record in its DNS zone.

Your hosting service should provide instructions on how to add the TXT record.

DMARCโ€‹

To comply with the DMARC framework, the application must be configured with an envelope sender โ€” an email address that the server has permission to send as. For example, if the application is hosted at https://my-journals.com, the envelope sender should be an email address @my-journals.com.

When a user signs up with example@gmail.com, your email server does not have permission to send as that address. The envelope sender acts as the "true" sender, and the email is sent "on behalf of" example@gmail.com.

To configure the envelope sender, edit the following settings in config.inc.php:

allow_envelope_sender = On
default_envelope_sender = noreply@yoursite.com
force_default_envelope_sender = On
force_dmarc_compliant_from = On

Sendmail vs SMTP vs PHPMailerโ€‹

Most hosting services provide SMTP credentials. If you have those, set the following in config.inc.php:

[email]
default = smtp
smtp = On
smtp_server = smtp.yourprovider.com
smtp_port = 587
smtp_auth = tls
smtp_username = you@domain.com
smtp_password = smtppassword

If no SMTP server is available, the server will likely send email through the sendmail application:

[email]
default = sendmail

If the sendmail binary is not at the usual location, you may need to set the path:

[email]
default = sendmail
sendmail_path = "/usr/sbin/sendmail -bs"
caution

PHPMailer is also available but is not secure and is strongly discouraged. Only use it as a last resort:

[email]
default = phpmailer

Gmailโ€‹

Use the following settings to send email through a personal Gmail account:

smtp = On
smtp_server = smtp.gmail.com
smtp_port = 465
smtp_auth = ssl
smtp_username = you@gmail.com
smtp_password = yourpassword

Commercial Servicesโ€‹

You can use a third-party email service such as Mailgun, Amazon SES, or Postmark. These are not officially supported out-of-the-box, but can be integrated via a small plugin. OJS uses Laravel's Mail library (Symfony Mailer), and transports exist for these services.

A community example Mailgun plugin is available at github.com/Vitaliy-1/mailgun.

Bounce Addressโ€‹

Once you have set an envelope_sender, a new setting will appear under Settings โ†’ Workflow โ†’ Emails allowing you to set a custom bounce address per journal.

note

This option may require changes to the server's mail server configuration so that the web server user (e.g., www-data) is trusted by the sendmail program; otherwise an X-Warning header will be added to outgoing messages.

Troubleshooting Email Problemsโ€‹

If emails are not being delivered, contact whoever runs your email server (usually your hosting provider). The application itself does not deliver emails โ€” it only requests that your email server deliver them.

When troubleshooting, ask your email server provider to:

  1. Verify that emails are being sent in compliance with SPF and DMARC protocols.
  2. Check server logs to confirm whether a specific email was sent.
  3. Check whether a sent email was "bounced" by the recipient's server, and why.