Skip to content
AISARAISAR
All articles

Connecting email

How to connect a work mailbox to AISAR: where to get an app password in Gmail, Yandex and Mail.ru, how to go through the connection wizard, how to reply to letters from the chat, and what to do when the mailbox check fails.

What the channel gives you

You connect the mailbox your customers write to, for example orders@ or info@. Letters from the Inbox folder show up in the shared chat next to WhatsApp and Telegram, and your team replies right from the chat: the reply goes to the customer as an ordinary email in the same thread, with the company signature.

The channel counts toward your plan's channel limit; there is no separate charge for it. Plan contents and current terms are on aisar.app.

What you'll need

  • An AISAR role that is allowed to connect channels (usually the company administrator).
  • The mailbox address and an app password for Gmail, Yandex or Mail.ru. These services do not accept your regular account password for third-party apps.
  • For mail on your own domain or at a hosting provider: the incoming (IMAP) and outgoing (SMTP) server addresses, the ports and the mailbox password.

Step 1. Get an app password

An app password is a separate password the service issues for one program. You can revoke it without changing your account password. The service shows it only once, so copy it whole right away.

Gmail and Google Workspace

  1. Turn on two-step verification: Google Account, "Security", "2-Step Verification". App passwords are not available without it.
  2. Open the "App passwords" page (myaccount.google.com/apppasswords), enter a name such as "AISAR" and click "Create".
  3. Copy the 16-letter password.
In Google Workspace the domain administrator can disable app passwords. If the option is missing, ask the administrator to allow them for this mailbox.

Yandex 360

  1. In the mail open "All settings", then "Mail clients". Turn on access from the imap.yandex.ru server via IMAP, with the sign-in method "App passwords and OAuth tokens".
  2. In Yandex ID open "Security", then "App passwords", and create a password of type "Mail" named "AISAR".
  3. Copy the password.
Without IMAP access turned on the check will fail even if the password is correct.

Mail.ru

  1. In the mail open "Settings", then "Security", the "Passwords for external apps" section, and click "Add".
  2. Enter a name such as "AISAR" and allow access to mail.
  3. Copy the password. Your regular mailbox password will not work.

Mail on your own domain or at a hosting provider

  1. The server addresses and ports come from your hosting provider: usually they are in the "Mail" section of the control panel or in the mailbox creation email.
  2. You need two servers: incoming (IMAP) and outgoing (SMTP). Often it is the same name, such as mail.yourdomain.com.
  3. Ports: IMAP 993 (SSL) or 143 (STARTTLS); SMTP 465 (SSL) or 587 (STARTTLS). The password is usually the same one you use for the hosting web mail.
Unencrypted connections and self-signed certificates are not supported. Enter the server name from your hosting settings, not an IP address: the certificate is issued for the name.

Step 2. The connection wizard

In the dashboard open Settings → Channels → Connect → Email. The wizard has five steps.

  1. Overview. A short summary of how the channel works and what to know in advance (the limits are listed below).
  2. Mail service. Choose where the mailbox lives: Gmail and Google Workspace, Yandex 360, Mail.ru or "Own server". If the address is on your company domain but Google or Yandex hosts the mail, pick them. For the first three the servers are filled in for you. Microsoft 365 and Outlook.com are not available yet: the wizard will say the connection is coming later.
  3. Mailbox and check. Enter the address, the app password (for your own server also the servers, ports and, if it differs from the address, the login) and an optional sender name: this is how the customer sees you in their mail. Click "Check connection". AISAR signs in to the mailbox and to the sending server, opens the Inbox and looks for the Sent folder. The result is shown separately for receiving (IMAP) and sending (SMTP). No test email is sent and the password is not stored until you connect. The check usually takes up to 20 seconds.
  4. Options. The signature (plain text, up to 2000 characters, appended to every reply); "Save a copy of the reply to Sent" (not needed for Gmail, which saves it itself; better to turn on for Yandex, Mail.ru and your own server); "Letters already in the mailbox": load only new ones, letters from the last 3 days or the last 7 days. Old letters land in the chat as history: the AI agent, automations and notifications do not fire on them. All of this can be changed later on the channel page.
  5. Done. The wizard shows the result: which address replies go from, whether old letters were loaded, and who can see the letters. The first letters appear in the chat within a few minutes.

The same mailbox cannot be connected to a company twice: on a second attempt the wizard offers to open the existing channel, where you can update the password and settings.

How letters look in the chat

  • Each letter is a message with the subject, sender and recipients (To, Cc). A long quote of previous letters is collapsed; the "Show quote" button reveals it. The whole letter opens in an isolated view with the "Open full letter" button.
  • Images from the internet in a letter are hidden by default: they let the sender learn that the letter was opened. The "Show images" button loads them through AISAR, so the sender does not see your address.
  • Bulk mail, auto-replies and automated letters carry badges ("Bulk", "Auto-reply", "Automated"). If the mail server did not confirm the sender, the letter is marked "Sender not verified": before paying or changing bank details, check with the customer another way. The AI agent and automations do not answer such letters, auto-replies or bulk mail.
  • Attachments can be downloaded; potentially dangerous files are flagged and need a confirmation to download. AISAR does not load a letter bigger than 25 MB: the chat shows a stub asking you to open it in the mailbox.

Replying to a letter

  • Write the reply in the input field as in any other channel. The subject is filled in automatically: "Re: …" plus the original subject, and the reply stays in the same thread.
  • The reply goes to the sender only. Cc addresses of the original letter are visible but are not added to the reply. There is no "Reply all" button.
  • The mailbox signature is appended to the reply, and, if "Quote the customer's letter in the reply" is on in the channel settings, so is a quote of their letter.

The first letter to a contact

To write first, open the conversation of a contact whose card has an email address (if there is none, the chat offers to open the card and add one). In the "Send to" field choose the email channel and the recipient address. For the first letter the subject is required: it cannot be sent without one. The mailbox signature is appended.

The "Email" tab on the channel page

Open Settings → Channels, pick the email channel and go to the "Email" tab.

  • Connection and mailbox check. The address, login, servers; the check status ("Working", "Check is delayed", "Stopped", "No connection to the server"), the time of the last check and of the last successful one.
  • Check interval. "Check the mailbox every" a few minutes; a change applies from the next check.
  • Incoming letters. The toggles "Skip bulk mail" (letters flagged as bulk will not reach the chat) and "Hide auto-replies" (when off, auto-replies such as "I'm on vacation" show up in the chat with a badge).
  • Sending. The sender name, the signature, "Quote the customer's letter in the reply", "Save a copy of the reply to Sent".
  • "Update password". Here you can also change the login and servers ("Change servers or login"). AISAR first checks sign-in with the new password and replaces the old one only after a successful check; the mailbox address itself cannot be changed.

If the app password was revoked or you changed your account password, the channel gets the "Expired" status, the check stops, and unsent letters in the chat show a hint. Create a new app password and enter it via "Update password": letters that arrived in the meantime will be fetched.

Limits

  • Microsoft 365 and Outlook.com mailboxes cannot be connected yet: Microsoft turned off password sign-in, and sign-in through a Microsoft account will come later. If the company has another mailbox, for example on Gmail or at a hosting provider, connect that one.
  • New letters do not arrive instantly: the mailbox is checked every 2–3 minutes (Gmail and own-server mail every 2 minutes by default, Yandex and Mail.ru every 3 minutes).
  • AISAR reads the Inbox folder only. The "read" mark in the mailbox is not changed, and already-read letters and letters sent from the mail program itself, bypassing AISAR, do not reach the chat.
  • This is not a mail client: folders, drafts and mailbox search stay in the mail service.
  • There is no "Reply all": a reply goes to the sender only.
  • Letters and attachments up to 25 MB. Up to 50 attachments per letter are loaded; the rest stay in the mailbox.
  • Email is not used for broadcasts: the channel is built for conversations with customers, not for mass sending.
  • If an AI agent is attached to the channel, its replies go out as email from the company address and affect the mailbox reputation with mail services. Every such letter is marked as automated.

Common errors

If the mailbox check fails, the wizard shows an error code and a hint. The codes are the same in the wizard, on the channel page and in the API.

CodeWhat it means and what to do
email_auth_failedThe mail server rejected the password. Most often a regular password was entered instead of an app password, the password was copied incompletely, the app password was revoked, or IMAP access is turned off in the mail settings (especially at Yandex). Create a new app password, make sure IMAP is on, and copy the password again. If the login differs from the address, enter it in the "Login" field. If the check keeps failing, after a series of errors it is temporarily blocked (see email_test_rate_limited).
email_tls_failedA secure connection could not be established: the server certificate is issued for another name, is self-signed, or the server does not offer encryption on the chosen port. Use the server name from your hosting settings (for example mail.company.com), not an IP address, and check the port and encryption pair (993 and 465 are SSL, 143 and 587 are STARTTLS).
email_host_blockedThe server address is not allowed: AISAR connects only to mail servers on the internet. Local or internal network addresses and service addresses are not accepted. Check the server name.
email_timeoutThe server did not answer in time. Repeat the check in a minute. If it keeps happening, check the server name and port, and that your hosting does not close the ports to external connections.
email_provider_requires_oauthThis is a Microsoft 365 or Outlook.com mailbox: it cannot be connected with a password. Connection through Microsoft sign-in will come later. For now connect another mailbox.
email_test_rate_limitedToo many failed checks for this mailbox. The check becomes available again later (usually in an hour), and the API response carries a Retry-After header. To avoid burning attempts, create a new app password and copy it whole: frequent errors look like password guessing to the mail service.

Less common are email_dns_failed (the server name was not found, check the spelling), email_host_unreachable (the server does not answer on this port; perhaps the hosting opens only 465 for sending and 993 for receiving), email_port_not_allowed (use IMAP 993 or 143 and SMTP 465 or 587), email_folder_not_found (the Inbox could not be opened, make sure IMAP is on) and email_protocol_error (the server answered unlike a mail server should, check the address and port). Connecting the same mailbox again returns mailbox_already_connected: open the existing channel.

See also

For an overview of the channel, see aisar.app/en/integrations/email. Sending letters and the other API operations are described in the REST groups "Channels", "Messages" and "Conversations".