Docs/Candor Deploy

Connect a mail app to your mailbox

Settings to add a mailbox on your mail server to Apple Mail on iPhone, iPad and Mac, the Gmail app on Android, Thunderbird or Outlook, and to send mail from code with Nodemailer.

If you run a mail server on one of your servers with Candor Deploy, you can read and send mail from any app that speaks IMAP and SMTP. This page gives the settings and the steps for the common ones.

The settings you need

Open Emails in the sidebar and choose your mail server. On the Overview tab, the Mail server card shows the host name; Protocol details opens the full settings. You need:

SettingValue
UsernameYour full email address, such as you@example.com. The same for incoming and outgoing mail.
PasswordThe mailbox’s password, set when the mailbox was created under Mailboxes.
Incoming (IMAP)The IMAP host shown, port 993, security SSL/TLS.
Outgoing (SMTP)The SMTP host shown, port 587, security STARTTLS.
AuthenticationNormal password. Not OAuth.

The dashboard does not keep passwords in readable form. If you lost one, set a new one for that mailbox. Keep it in a password manager.

Your domain’s mail DNS records (MX, SPF, DKIM and DMARC) must be published for mail to be delivered and to stay out of spam folders. Check them on the DNS tab.

iOS

Apple Mail works the same way on iPhone, iPad and Mac.

  1. On iPhone or iPad, open Settings, then Mail, Accounts, Add Account, Other, and tap Add Mail Account. On a Mac, open Mail, then Mail, Add Account, Other Mail Account.
  2. Enter your name, your full email address, the password, and a description such as “Work mail”. Tap Next.
  3. Make sure IMAP is selected at the top.
  4. Under Incoming Mail Server, enter the IMAP host, and your full email address as the user name.
  5. Under Outgoing Mail Server, enter the SMTP host, and the same user name and password. iOS may label these “Optional”; they are required.
  6. Tap Next. Checking the account can take up to a minute. Choose what to sync (Mail is enough) and tap Save.

If it cannot verify the account, open the account, then Advanced, and check: IMAP on port 993 with Use SSL on; SMTP on port 587 with Use SSL on and authentication set to Password.

If you see Cannot Verify Server Identity, check that the host names you entered are exactly the ones the dashboard shows. A certificate is issued for those names, not for your bare domain. If the names match and the warning stays, check the certificate on the mail server’s page and contact us rather than accepting a certificate you are unsure of.

Android

These steps are for the Gmail app. Other Android mail apps ask for the same settings.

  1. Open Gmail, tap your profile picture at the top right, then Add another account.
  2. Choose Other (not Google and not Outlook).
  3. Enter your full email address and tap Manual setup. Automatic setup often picks the wrong port.
  4. Choose Personal (IMAP), enter your password and tap Next.
  5. Incoming server settings: user name is your full email address, server is the IMAP host, port 993, security type SSL/TLS. Tap Next.
  6. Outgoing server settings: server is the SMTP host, port 587, security type STARTTLS. Keep Require sign-in on and enter your password again. Tap Next.
  7. Choose how often to check for mail, then tap Next.

Gmail checks an IMAP account at the interval you chose; new mail does not arrive instantly. If you see Couldn’t open connection to server, open the account’s server settings and check 993 with SSL/TLS for incoming and 587 with STARTTLS for outgoing.

Desktop

Any desktop mail app works with the settings at the top of this page. When it offers to detect them for you, choose manual setup instead.

Thunderbird

  1. Choose File, then New, then Existing Mail Account.
  2. Enter your name, full email address and password, and click Continue.
  3. When it starts detecting settings, click Configure manually.
  4. Incoming: IMAP, the IMAP host, port 993, SSL/TLS, Normal password. Outgoing: SMTP, the SMTP host, port 587, STARTTLS, Normal password. User name on both: your full email address.
  5. Click Re-test, then Done.

Outlook (classic, Windows)

  1. Choose File, then Add Account.
  2. Enter your email address, open Advanced options, tick Let me set up my account manually, and click Connect.
  3. Choose IMAP.
  4. Incoming: the IMAP host, port 993, encryption SSL/TLS. Outgoing: the SMTP host, port 587, encryption STARTTLS.
  5. Enter your password, let Outlook check the account, and click Done.

Common problems

  • “Username and password not accepted” when they are right: the user name must be the full email address, not just the part before the @.
  • A certificate warning: the host name you entered does not match the one in the dashboard. Copy it from the Mail server card.
  • Sending fails but receiving works: outgoing mail needs sign-in too. Turn on authentication for the SMTP server with the same user name and password.

Nodemailer

To send mail from your own app, use SMTP with the same settings. This example uses Nodemailer for Node.js.

npm install nodemailer

Keep the settings in environment variables, marked secret in the dashboard, never in your code:

import nodemailer from "nodemailer";

export const transporter = nodemailer.createTransport({
  host: process.env.SMTP_HOST,         // the SMTP host from the dashboard
  port: Number(process.env.SMTP_PORT), // 587
  secure: false,                       // starts plain, then upgrades with STARTTLS
  requireTLS: true,                    // refuse to send if the upgrade fails
  auth: {
    user: process.env.SMTP_USER,       // the full email address
    pass: process.env.SMTP_PASS,
  },
});

Port 465 with implicit TLS also works: set port: 465 and secure: true, and remove requireTLS.

Check the connection when your app starts, so a wrong setting fails straight away:

await transporter.verify();

Then send:

await transporter.sendMail({
  from: '"Your App" <you@example.com>',
  to: "alice@example.com",
  subject: "Hello",
  text: "Plain-text body.",
});

Other languages use the same five things: host, port, TLS mode, user name and password. In Python:

import smtplib
from email.message import EmailMessage

msg = EmailMessage()
msg["From"] = "you@example.com"
msg["To"] = "alice@example.com"
msg["Subject"] = "Hello"
msg.set_content("Plain-text body.")

with smtplib.SMTP("smtp.example.com", 587) as s:
    s.starttls()
    s.login("you@example.com", "PASSWORD")
    s.send_message(msg)

Good practice:

  • Create one transporter when your app starts and reuse it. A new connection per message is slow.
  • Send from an address on a mailbox or alias that exists on your mail server. Other From addresses are rejected by your SPF and DMARC policy.
  • Retry sendMail on a temporary network error.
  • If mail stops sending, check the mail server’s Health tab, which shows the outgoing queue.

Something here wrong, unclear or missing? Tell us. Docs get fixed like bugs.

Not a customer yet? Start a free trial, or see plans and limits.