Skip to main content


The $mail built-in service allows sending email messages from the bot script.

To use the $email service, you will need a mail server implementing the SMTP protocol. You can try ready-to-use cloud solutions or run your own server.

Another option to send email messages is to use the Email action tag: it doesn’t require you to configure a mail server. However, all messages will have as their sender.


configConfigure the SMTP server settings.
debugEnable or disable the $mail service debug mode.
sendSend an email message and pass the SMTP server settings.
sendMessageSend an email message via the pre-configured SMTP server.

SMTP server configuration

When your server is ready to use, you need to provide its settings in the script. This can be done in several ways:

  • In the injector.smtp section of the chatbot.yaml configuration file.
  • Using the $mail.config method.
  • Simultaneously with sending an email, using the $mail.send method.
host: # SMTP server host
port: 2525 # SMTP server port
user: # SMTP server user
password: qwerty # SMTP server password
from: # Email sender

# Optional properties
hiddenCopy: # Email hidden copy recipient
# You can specify a list of recipients:
# hiddenCopy:
# -
# -
debugMode: true # Whether debug mode is on or off
The recommended way to provide the settings is to use the $mail methods instead of chatbot.yaml. This allows you to store them separately from the script as secrets and variables rather than in the source code. You will be able to modify the settings easily without changing the code, and sensitive data will be more secure.