Custom SMTP server


Only available on Engine 4.0.4 (or for customers)

You can setup one or many public forms on your site (see Create a contact form).

When a visitor submits one of those forms, the Engine sends a notification email to a list of accounts.
To send this email, by default, the Ruby on Rails Engine application uses the ActionMailer configuration which will be common to all the Locomotive sites.

In some situations, you'd rather use a custom SMTP server with a custom domain per LocomotiveCMS site.

Here are the steps to let the Engine know about this custom server

1. Add a new site metafields namespace

You've to add a new Site metafields namespace to your site.

  label: SMTP settings
      label: "Address"
      type: string
      hint: "Ex: If blank, Locomotive will use the default mailer settings."
      label: "Authentication"
      type: string
      hint: 'Ex: plain'
      label: "Port"
      type: integer
      hint: "Ex: 587"
      label: "Start TTLS?"
      type: boolean
      label: "Username"
      type: string
      label: "Password"
      type: string
      label: "Domain"
      type: string
      label: "From"
      type: string
      hint: "Also used for the reply_to field"


The allowed namespace names that will enable the feature are:

mailer_settings, smtp_settings and email_settings .

2. Deploy your modifications

Inside the folder of your Wagon site, type the following command:

wagon deploy <env> -r site -v

3. Fill the information in the Locomotive UI

Open your browser, go to your Locomotive site back-office. Then, click on properties in the left sidebar and select the SMTP settings tab. You should see something like this:

Finally, save your modifications.

From now, Locomotive will use the SMTP server you've defined to send notifications emails!