Skip to content

Send emails using Mailgun

Sukhpal Saini edited this page Jul 26, 2021 · 2 revisions

Candymail supports all SMTP email services. Mailgun is a good one to use.

Set up

  • Sign up for a Mailgun account here here
  • From the right side, select Sending > Domain Settings > Add a new SMTP user. This will be your user and pass.

Add to Candymail config

Initialize Candymail config with Mailgun STMP.

candymail.init(automation.workflows, {
  mail: {
    host: 'smtp.gmail.com',
    port: 465,
    secure: true,
    auth: {
      user: process.env.MAIL_USER,
      pass: process.env.MAIL_PASSWORD,
    },
    tls: {
      rejectUnauthorized: true,
    },
  },
  hosting: { url: process.env.HOSTING_URL },
  db: { reset: true },
  debug: { trace: true },
})
Clone this wiki locally