Links
Comment on page

Send emails using Mailgun

Send emails using Mailgun

Setup a new account

  • 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.

Initialize Candymail

Initialize Candymail config with Mailgun STMP.
candymail.init(automation.workflows, {
mail: {
host: 'smtp.mailgun.org',
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 },
})