> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Email

> Configures and manages email SMTP connections. You can perform notification, alarm, and bulk email sending operations via TLS-enabled SMTP, make environment-based settings, and ensure compatibility with different service providers

## Overview

<AccordionGroup>
  <Accordion title="What is its Purpose?">
    <CardGroup cols={2}>
      <Card title="Secure Access" icon="shield">
        This Connection enables integration steps running on Apinizer to securely access SMTP servers.
      </Card>

      <Card title="Central Management" icon="gear">
        Provides manageability from a single configuration point in warning, alarm, notification, or bulk email scenarios.
      </Card>

      <Card title="Advanced Parameters" icon="slider">
        Ensures compatibility with different service providers thanks to advanced parameters such as TLS, authentication, and custom SMTP headers.
      </Card>

      <Card title="Environment-Based Settings" icon="code-branch">
        Reduces repetitive definitions in Development/Test/Production distinctions thanks to environment-based settings.
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="Working Principle">
    <CardGroup cols={2}>
      <Card title="Connection Initialization" icon="play">
        When SMTP type Connection is requested from within Integration Flow or Connector, the system reads configured connection parameters.
      </Card>

      <Card title="Connection Pool Management" icon="layer-group">
        Email Connections work with lightweight sessions opened per request; pool is disabled but worker queues queue concurrent requests.
      </Card>

      <Card title="Authentication" icon="shield">
        Authentication is performed with username/password if Auth toggle is on, otherwise with anonymous SMTP access.
      </Card>

      <Card title="Data Communication" icon="arrows-rotate">
        MIME messages and additional headers are sent via SMTP with TLS/STARTTLS support.
      </Card>

      <Card title="Connection Management" icon="gear">
        After the operation is completed, session is closed and worker returns to clean state for new requests.
      </Card>

      <Card title="Error Management" icon="triangle-exclamation">
        In case of connection error, timeout, or authentication error, details are written to Apinizer logs, error message and recommended actions are notified to the user.
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Usage Areas">
    <CardGroup cols={2}>
      <Card title="Automatic Notifications" icon="bell">
        Automatic email notifications for system events or monitoring alarms
      </Card>

      <Card title="Secure Mailboxes" icon="envelope">
        Secure mailboxes that send verification codes from identity providers
      </Card>

      <Card title="PDF Attachment Communication" icon="file-pdf">
        Outgoing communication scenarios with PDF attachments such as invoices, receipts, or reports
      </Card>

      <Card title="Periodic Reports" icon="clock">
        Sharing periodic status/health reports via Scheduled Jobs
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Technical Features and Capabilities

<AccordionGroup>
  <Accordion title="Basic Features">
    <CardGroup cols={2}>
      <Card title="STARTTLS Support" icon="shield">
        Upgrades SMTP sessions to TLS with `enableStartTls` toggle.
      </Card>

      <Card title="Conditional Authentication" icon="key">
        When `auth` is active, username/password becomes mandatory and credential verification is performed.
      </Card>

      <Card title="Sender Identity Management" icon="user">
        Sender address to be used in all messages is centrally defined with `from` field.
      </Card>

      <Card title="Environment-Based Configuration" icon="code-branch">
        Ability to define separate connection parameters for each environment (Development, Test, Production).
      </Card>

      <Card title="Enable/Disable Control" icon="toggle-on">
        Making Connection active or passive (enable/disable toggle). In passive state, connection cannot be used but its configuration is saved.
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Advanced Features">
    <CardGroup cols={2}>
      <Card title="Additional SMTP Properties" icon="slider">
        Server-specific headers or protocol parameters can be added with `additionalProperties`.
      </Card>

      <Card title="Address-Based Test Sending" icon="flask">
        Verification is performed before actual sending with `addressToTest` field and Test Mail button.
      </Card>

      <Card title="Deployment to Worker" icon="server">
        Deployment of Connection to gateway or worker processes is controlled with `deployToWorker` flag.
      </Card>

      <Card title="Connection Test Feature" icon="check-circle">
        Ability to verify connection parameters before saving with "Test Connection" button.
      </Card>

      <Card title="Export/Import Feature" icon="file-export">
        Exporting Connection configuration as ZIP file. Importing to different environments (Development, Test, Production). Version control and backup capability.
      </Card>

      <Card title="Connection Monitoring" icon="chart-line">
        Monitoring connection health, pool status, and performance metrics.
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Connection Parameters

<AccordionGroup>
  <Accordion title="Required Parameters">
    <CardGroup cols={2}>
      <Card title="Name" icon="tag">
        **Description:** Connection name (must be unique)\
        **Example Value:** `Production_EmailSMTP`\
        **Notes:** Should not start with space, special characters should not be used
      </Card>

      <Card title="Host" icon="server">
        **Description:** FQDN/IP information of SMTP server\
        **Example Value:** `smtp.mailprovider.com`\
        **Notes:** 255 character limit
      </Card>

      <Card title="Port" icon="network-wired">
        **Description:** SMTP port number\
        **Example Value:** `587`\
        **Notes:** 587 recommended for TLS, 465 for SSL
      </Card>

      <Card title="From" icon="envelope">
        **Description:** Sender address to be used in messages\
        **Example Value:** `noreply@company.com`\
        **Notes:** Must be valid email format
      </Card>

      <Card title="Default Encoding" icon="language">
        **Description:** Body/header character set\
        **Example Value:** `UTF-8`\
        **Notes:** Comes as UTF-8 by default in UI
      </Card>

      <Card title="Username (Auth on)" icon="user">
        **Description:** SMTP account username\
        **Example Value:** `alert.bot`\
        **Notes:** Required when Auth toggle is on
      </Card>

      <Card title="Password (Auth on)" icon="lock">
        **Description:** SMTP account password\
        **Example Value:** `••••••`\
        **Notes:** Required when Auth toggle is on
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Optional Parameters">
    <CardGroup cols={2}>
      <Card title="Description" icon="file-lines">
        **Description:** Description field for Connection purpose\
        **Default Value:** Empty\
        **Recommended Value:** Example: Prod alarm mail channel
      </Card>

      <Card title="Enable STARTTLS" icon="shield">
        **Description:** Toggle for upgrading to TLS\
        **Default Value:** false\
        **Recommended Value:** true in environments where TLS is mandatory
      </Card>

      <Card title="Auth" icon="key">
        **Description:** Authentication requirement\
        **Default Value:** false\
        **Recommended Value:** true in most providers
      </Card>

      <Card title="AddressToTest" icon="flask">
        **Description:** Address where test mail will be sent\
        **Default Value:** Empty\
        **Recommended Value:** Dev team distribution list
      </Card>

      <Card title="Additional Properties" icon="slider">
        **Description:** Provider-specific key/value set for SMTP\
        **Default Value:** Empty array\
        **Recommended Value:** Like `mail.smtp.connectiontimeout=15000`
      </Card>

      <Card title="DeployToWorker" icon="server">
        **Description:** Deployment option on worker
        **Default Value:** true
        **Recommended Value:** Kept true in high traffic scenarios
      </Card>

      <Card title="Use SSL" icon="shield-halved">
        **Description:** Determines whether SSL/TLS is used for SMTP connection
        **Default Value:** false
        **Recommended Value:** true in production environments
      </Card>

      <Card title="Certificate" icon="certificate">
        **Description:** Certificate selection used when SSL is active
        **Default Value:** Empty (system certificates are used)
        **Recommended Value:** Relevant certificate should be selected for self-signed servers
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Timeout and Connection Pool Parameters">
    <CardGroup cols={2}>
      <Card title="Connection Timeout" icon="clock">
        **Description:** Maximum wait time for establishing connection\
        **Default:** 30000\
        **Min:** 5000 | **Max:** 60000\
        **Unit:** milliseconds
      </Card>

      <Card title="Request Timeout" icon="hourglass">
        **Description:** Maximum wait time for request response\
        **Default:** 60000\
        **Min:** 10000 | **Max:** 120000\
        **Unit:** milliseconds
      </Card>

      <Card title="Pool Size" icon="layer-group">
        **Description:** Maximum number of connections in Connection pool\
        **Default:** 1\
        **Min:** 1 | **Max:** 5\
        **Unit:** count
      </Card>

      <Card title="Mail Retry Delay" icon="repeat">
        **Description:** Wait between failed SMTP attempts\
        **Default:** 2000\
        **Min:** 1000 | **Max:** 10000\
        **Unit:** milliseconds
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Usage Scenarios

<CardGroup cols={2}>
  <Card title="Alarm Notifications" icon="bell">
    **Situation:** Monitoring system produces critical alarm\
    **Solution:** Host=smtp.ops.local, From=[alerts@company.com](mailto:alerts@company.com), Auth=true\
    **Expected Behavior:** Alarm mail goes to recipient list via TLS
  </Card>

  <Card title="User Verification Codes" icon="key">
    **Situation:** OTP sent during authentication process\
    **Solution:** Port=587, Enable STARTTLS=true, DeployToWorker=true\
    **Expected Behavior:** OTP message is transmitted within seconds
  </Card>

  <Card title="Financial Reporting" icon="file-pdf">
    **Situation:** Monthly reports with PDF attachments sent\
    **Solution:** AdditionalProperties with `mail.smtp.writetimeout=120000`\
    **Expected Behavior:** Large attachments sent without timeout
  </Card>

  <Card title="Test Environment Smoke Test" icon="flask">
    **Situation:** Dummy address for test environment scenarios\
    **Solution:** Environment=Test, Auth=false, From=[test@dummy.local](mailto:test@dummy.local)\
    **Expected Behavior:** Messages fall to sandbox SMTP
  </Card>

  <Card title="External Service Failover" icon="rotate">
    **Situation:** Secondary activates when primary SMTP is down\
    **Solution:** Host=primary, AdditionalProperties.failover=smtp2\
    **Expected Behavior:** Second host is used without flow interruption
  </Card>

  <Card title="Bulk Campaign" icon="envelope">
    **Situation:** High volume in marketing campaign\
    **Solution:** Pool Size=5, DeployToWorker=true, Description=Campaign\
    **Expected Behavior:** Workers distribute load and increase throughput
  </Card>
</CardGroup>

## Connection Configuration

### Creating New Email Connection

<img src="https://mintcdn.com/apinizer/YX1NcEKlSBeHefxE/images/yonetici/baglantilar/email-new-variable.png?fit=max&auto=format&n=YX1NcEKlSBeHefxE&q=85&s=8365ed54ebbc555caf206f1d40520e8e" alt="Image 2024 9 9 15 35 35 Pn" width="1000" className="mr-auto" data-path="images/yonetici/baglantilar/email-new-variable.png" />

#### Configuration Steps

<Steps>
  <Step title="Going to Creation Page">
    * Click **Connection** option from left menu on Apinizer main screen.
    * Select **Email** option from opened submenu.
    * Email Connection list page opens.
    * Click **\[+ Create]** button in top right corner of page.
    * New Email Connection creation form opens.
  </Step>

  <Step title="Entering Basic Information">
    **Enable Status (Active Status) Setting:**

    * Find **Enable Status** toggle at top of form.
    * Set toggle to **Active** position (comes active by default).
    * If you want to make Connection passive, set toggle to **Passive** position.
    * Passive connections cannot be used in Integration Flows but their configurations are saved.

    **Name (Name) - Required Field:**

    * Enter a unique connection name in **Name** field.
    * Name examples: `Production_EmailSMTP`, `Test_EmailConnection`, `Dev_SMTP_Alerts`
    * Name rules:
    * Should not start with space
    * Special characters should not be used (recommended: letter, number, underscore)
    * Maximum 255 characters
    * System automatically checks as you type name:
    * Green checkmark: Name is available
    * Red X mark: Name already exists, select different name

    **Description (Description) - Optional:**

    * Enter text describing the purpose of connection in **Description** field.
    * Example descriptions:
    * "SMTP channel for alarms"
    * "Production environment email notifications"
    * "Dummy SMTP connection for test environment"
    * Maximum 1000 character limit exists.
    * This field can be left empty.

    <Info>
      In the action button area at the top of the page, you can use the **\[\<> Variable]** button to select dynamic values, and with global variables, you can manage connection parameters with variable-based values instead of fixed values. For detailed information, review the [Dynamic Variables](/en/concepts/core-concepts/dynamic-variables) page.
    </Info>
  </Step>

  <Step title="Environment Selection">
    * Find **Environment** dropdown menu.
    * Open dropdown menu and select one of the following options:
    * **Development**: For development environment
    * **Test**: For test environment
    * **Production**: For production environment
    * Different connection parameters can be defined for each environment.
    * Environment selection determines in which environment connection will be active.
    * Connections with same name can be created separately for different environments.
  </Step>

  <Step title="SMTP Server Information">
    **Host (Server Address) - Required:**

    * Enter SMTP server address in **Host** field.
    * Host format:
    * FQDN (Fully Qualified Domain Name): `smtp.mailprovider.com`
    * IP address: `192.168.1.100`
    * Maximum 255 character limit exists.
    * Get correct host address from your SMTP provider's documentation.

    **Port (Port Number) - Required:**

    * Enter SMTP port number in **Port** field.
    * Common port numbers:
    * **25**: Standard SMTP (usually unencrypted)
    * **465**: SMTP with SSL/TLS (SMTPS)
    * **587**: SMTP with STARTTLS (recommended)
    * Check correct port number from your SMTP provider's documentation.
    * Port number must be between 1-65535.

    **Enable STARTTLS Setting:**

    * Find **Enable STARTTLS** toggle.
    * If your SMTP provider requires TLS/STARTTLS, set toggle to **Active** position.
    * If using port 587, STARTTLS should generally be active.
    * If using port 465, STARTTLS is generally not needed (SSL/TLS is used directly).
    * Check provider documentation to make correct setting.

    <Tip>
      Port 587 and STARTTLS combination is recommended for most modern SMTP providers.
    </Tip>

    **Use SSL Setting:**

    * Find **Use SSL** toggle.
    * If your SMTP server requires SSL/TLS, set toggle to **Active** position.
    * When SSL is enabled, a **certificate** can optionally be selected.
    * If no certificate is selected, default JVM certificates are used.
    * For SMTP servers using self-signed certificates, you can define the relevant certificate in [Secrets Management → Certificates](/en/admin/secrets-management/certificates) and select it here.
  </Step>

  <Step title="Sender and Authentication">
    **From (Sender Address) - Required:**

    * Enter sender email address in **From** field.
    * Format: Must be valid email address format.
    * Examples: `noreply@company.com`, `alerts@company.com`, `test@dummy.local`
    * This address will appear as sender in all sent emails.
    * Ensure your DNS/SPF records support this address.

    **Auth (Authentication) Setting:**

    * Find **Auth** toggle.
    * If your SMTP server requires authentication, set toggle to **Active** position.
    * Most modern SMTP providers require authentication.

    **Username (Username) - Required when Auth is on:**

    * If **Auth** toggle is active, **Username** field becomes visible.
    * Enter username of your SMTP account.
    * Examples: `alert.bot`, `smtp.user`, `noreply@company.com`
    * In some providers, username may be full email address.
    * Check correct format from your SMTP provider's documentation.

    **Password (Password) - Required when Auth is on:**

    * If **Auth** toggle is active, **Password** field becomes visible.
    * Enter password of your SMTP account.
    * Password will appear masked for security reasons.
    * You can click eye icon to see password.
    * Use of secret manager is recommended for sensitive information.
  </Step>

  <Step title="Timeout and Connection Pool Settings">
    * No field exists directly in UI for timeout and pool settings.
    * Use **Additional Properties** section to make these settings (detailed in Step 7).
    * Common timeout settings:
    * `mail.smtp.connectiontimeout=30000` (30 seconds)
    * `mail.smtp.timeout=60000` (60 seconds)
    * `mail.smtp.writetimeout=120000` (120 seconds - for large attachments)
    * Connection pool settings generally work with default values.
    * Add to Additional Properties for special requirements.
  </Step>

  <Step title="Additional Properties and Security Settings">
    **Additional Properties (Additional Properties) - Optional:**

    * Find **Additional Properties** section.
    * Use this section to add provider-specific parameters for your SMTP provider.
    * Add parameters in Key-Value format:
    * Example: `mail.smtp.connectiontimeout=15000`
    * Example: `mail.smtp.writetimeout=120000`
    * Commonly used properties:
    * `mail.smtp.connectiontimeout`: Connection timeout (milliseconds)
    * `mail.smtp.timeout`: General timeout (milliseconds)
    * `mail.smtp.writetimeout`: Write timeout (milliseconds)
    * `mail.smtp.auth.mechanisms`: Authentication mechanism
    * Add one key-value pair per line.
    * Check supported properties from your SMTP provider's documentation.

    **AddressToTest (Test Address) - Optional:**

    * Find **AddressToTest** field.
    * Enter email address to be used for test mail sending.
    * This address is where test mail will be sent when **Test Connection** button is clicked.
    * Example: `dev-team@company.com`, `test@dummy.local`
    * This field can be left empty, but filling it is recommended for testing.

    **DeployToWorker Setting:**

    * Find **DeployToWorker** toggle.
    * Set toggle to **Active** position in high traffic scenarios.
    * Deployment on worker is recommended for load distribution and performance.
    * Comes active by default.
  </Step>

  <Step title="Test Connection">
    * Find **\[Test Connection]** button at bottom of form or in top right corner.
    * Click button.
    * System tests connection parameters:
    * Connection is established to SMTP server
    * Authentication is performed (if Auth is active)
    * STARTTLS handshake is performed (if active)
    * Test mail is sent (if AddressToTest is filled)
    * Test result:
    * **Successful**: Green confirmation message is displayed, message like "Connection test successful"
    * **Failed**: Red error message is displayed, error details are shown
    * In error case:
    * Read error message
    * Check relevant parameters (Host, Port, Username, Password)
    * Check firewall and network settings
    * Check SMTP provider documentation
    * Fix parameters and test again until test is successful.
  </Step>

  <Step title="Saving and Deploying">
    * Ensure all required fields are filled.
    * Verify that test connection is successful (recommended).
    * Click **\[Save and Deploy]** button in top right corner of form.
    * System saves connection and deploys to selected environment.
    * After successful save:
    * You are redirected to Connection list page
    * New connection appears in list
    * Connection becomes **Enabled** status
    * Becomes available for use in Integration Flow and Connector steps

    **Checklist (Before Saving):**

    * Name field is unique and valid
    * Host and Port fields are filled
    * From address is in valid email format
    * If Auth is active, Username and Password are filled
    * Environment is selected
    * Test Connection is successful (recommended)
    * All required fields are filled

    **Result:**

    * Connection is successfully created and saved
    * Becomes active in selected environment
    * Connection selection can be made in Integration Flow and Connector steps
    * Is displayed and can be managed in Connection list

    <Check>
      Connection created successfully! You can now use it in Integration Flow and Connector steps.
    </Check>
  </Step>
</Steps>

### Deleting Connection

<CardGroup cols={2}>
  <Card title="Deletion Operation" icon="trash">
    Select **Delete** from **⋮** menu at end of row or click **\[Delete]** button on connection detail page
  </Card>

  <Card title="Deletion Tips" icon="info-circle">
    **Check Before Deleting:** May be used in Integration Flow or Connector steps. Assign alternative connection if necessary. Backup with **Export** before deleting

    **Alternative: Deactivate**

    * Use **Disable** option instead of deleting.
    * Connection becomes passive but is not deleted.
    * Can be reactivated when needed.
  </Card>
</CardGroup>

### Exporting/Importing Connection

<Info>
  In this step, users can export (export) existing connections for backup, moving to different environments, or sharing purposes, or import (import) a previously exported connection again. This operation is used to maintain data integrity in version control, transitions between test and production environments, or inter-team sharing processes.
</Info>

<AccordionGroup>
  <Accordion title="Export">
    <CardGroup cols={2}>
      <Card title="Method 1" icon="download">
        Select **⋮ → Export** from action menu. ZIP file is automatically downloaded.
      </Card>

      <Card title="Method 2" icon="file-export">
        Click **\[Export]** button on Connection detail page. ZIP file is downloaded.
      </Card>

      <Card title="File Format" icon="file-zipper">
        Format: `Date-connection-ConnectionName-export.zip`\
        Example: `13 Nov 2025-connection-Production_EmailSMTP-export.zip`
      </Card>

      <Card title="ZIP Contents" icon="folder-open">
        * Connection JSON file
        * Metadata information
        * Dependency information (e.g., certificates, key store)
      </Card>

      <Card title="Usage Areas" icon="list-check">
        * Backup
        * Moving between environments (Test → Prod)
        * Versioning
        * Team or project-based sharing
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Import">
    <CardGroup cols={2}>
      <Card title="Import Steps" icon="upload">
        * Click **\[Import Email]** button on main list.
        * Select downloaded ZIP file.
        * System checks: Is format valid? Is there name conflict? Are dependencies present?
        * Then click **\[Import]** button.
      </Card>

      <Card title="Import Scenarios" icon="info-circle">
        **Scenario 1: Name Conflict** → Overwrite old connection or create with new name.

        **Scenario 2: Missing Dependencies** → Create missing certificates or key stores first or exclude during import.
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

### Usage Areas of Connection

<CardGroup cols={2}>
  <Card title="Creating and Activating Connection" icon="plus-circle">
    **Steps:**

    1. Create Connection.
    2. Verify connection with **Test Connection**.
    3. Save and activate with **Save and Deploy**.
    4. Ensure Connection is in **Enabled** status
  </Card>

  <Card title="Usage in Integration / Connector Steps" icon="plug">
    Connection is selected in steps requesting communication with external systems such as message queue (queue), topic, email, FTP/SFTP, LDAP, or similar. Examples: steps like "Send Message", "Consume Message", "Upload File", "Read Directory". Connection selection is made from **Connection** field in these steps' configuration
  </Card>

  <Card title="Scheduled Job Usage" icon="clock">
    Connection is selected in scheduled tasks (e.g., sending messages at certain intervals, file processing, etc.) to access external systems. When Connection changes, job execution behavior is also updated accordingly
  </Card>

  <Card title="Test Purpose Usage" icon="flask">
    Connection accuracy can be checked independently of Integration Flow with Connection Test feature. This test is critical in debugging process
  </Card>
</CardGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Things to Do and Best Practices">
    <CardGroup cols={2}>
      <Card title="SMTP Provider Management" icon="server">
        **Bad:** Managing different providers with same Connection.\
        **Good:** Opening separate Connection for each provider.\
        **Best:** Specifying environment + provider combination in name (Prod\_SendGrid)
      </Card>

      <Card title="Sender Identity" icon="envelope">
        **Bad:** Changing `from` field with random addresses.\
        **Good:** Using meaningful addresses according to business processes.\
        **Best:** Defining corporate alias compatible with DMARC/SPF records
      </Card>

      <Card title="Credential Lifecycle" icon="key">
        **Bad:** Never updating shared passwords.\
        **Good:** Rotating manually at intervals.\
        **Best:** Setting up rotation automation through secret manager
      </Card>

      <Card title="Additional Parameter Management" icon="slider">
        **Bad:** Leaving `additionalProperties` field empty.\
        **Good:** Adding only needed keys.\
        **Best:** Recording all mandatory SMTP properties from provider documentation
      </Card>

      <Card title="Environment Management" icon="code-branch">
        **Bad:** Using same connection parameters in all environments.\
        **Good:** Creating separate connection for each environment.\
        **Best:** Managing all environments in single connection using environment option, only changing environment during inter-environment transitions
      </Card>

      <Card title="Connection Test" icon="flask">
        **Bad:** Saving and deploying Connection without testing.\
        **Good:** Verifying with Test Connection before saving.\
        **Best:** Testing after each parameter change, performing full integration test in test environment before moving to production
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Security Best Practices">
    <CardGroup cols={2}>
      <Card title="SMTP Authentication" icon="shield">
        When Auth is on, username/password should only be visible to necessary roles. Do not copy and share passwords through UI
      </Card>

      <Card title="Role-Based Access" icon="user-shield">
        Limit `enable/disable` permissions to teams responsible for email infrastructure; incorrect configuration can stop all notifications
      </Card>

      <Card title="Additional Parameter Security" icon="lock">
        If sensitive keys exist in `additionalProperties`, keep values with masked secret references
      </Card>

      <Card title="Credential Management" icon="key">
        Store sensitive information such as username and password using environment variable or secret manager. Do not hardcode credentials in code or configuration files. Update passwords periodically
      </Card>

      <Card title="SSL/TLS Usage" icon="shield-halved">
        Always enable SSL/TLS in Production environment. Use self-signed certificates only in development environment. Track certificate expiration dates and renew on time
      </Card>

      <Card title="Access Control" icon="user-shield">
        Allow only authorized users to change Connection configuration. Store Connection change logs. Apply change approval process for critical connections
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Things to Avoid">
    <CardGroup cols={2}>
      <Card title="Single Server Dependency" icon="exclamation-triangle">
        **Why to avoid:** All email flow stops when primary SMTP service is interrupted.\
        **Alternative:** Define secondary host with `additionalProperties` or separate Connection
      </Card>

      <Card title="Shared Credentials" icon="users-slash">
        **Why to avoid:** Password leak affects all processes.\
        **Alternative:** Open separate user account for each application, audit accesses
      </Card>

      <Card title="Wrong Sender Address" icon="envelope">
        **Why to avoid:** SPF/DKIM incompatibility causes emails to fall into spam folder.\
        **Alternative:** Use approved domain aliases and keep DNS records up to date
      </Card>

      <Card title="Using Production Connection in Test Environment" icon="triangle-exclamation">
        **Why to avoid:** Test data may be written to production system, real users may be affected, security risk occurs.\
        **Alternative:** Create separate connection for each environment, use environment parameter, separate connection names by adding prefix according to environment (Test\_, Prod\_)
      </Card>

      <Card title="Very Low Timeout Values" icon="clock">
        **Why to avoid:** Connection constantly times out in network delays, Integration steps fail.\
        **Alternative:** Adjust timeout values according to real usage scenarios, measure network latency and determine timeouts accordingly
      </Card>

      <Card title="Not Using Connection Pool" icon="layer-group">
        **Why to avoid:** New connection opens on each request, performance decreases, resource consumption increases, target system load increases.\
        **Alternative:** Enable Connection pool, adjust pool size according to traffic volume, set up pool monitoring
      </Card>
    </CardGroup>
  </Accordion>

  <Accordion title="Performance Tips">
    <CardGroup cols={2}>
      <Card title="SMTP Host Selection" icon="server">
        **Recommendation:** Prefer SMTP hosts in same datacenter.\
        **Effect:** Network delay decreases, timeout risk decreases
      </Card>

      <Card title="Additional Parameter Optimization" icon="slider">
        **Recommendation:** Adjust `mail.smtp.connectiontimeout`, `mail.smtp.writetimeout` values according to real load tests.\
        **Effect:** Stable performance even with large attachments
      </Card>

      <Card title="Test Mail Automation" icon="flask">
        **Recommendation:** Trigger Test Connection API in CI/CD.\
        **Effect:** Incorrect configurations are caught before moving to production
      </Card>

      <Card title="Connection Pool Optimization" icon="layer-group">
        **Recommendation:** Adjust pool size according to peak traffic (recommended: concurrent request count × 1.5), set idle connection timeouts, perform pool health check.\
        **Effect:** Connection opening cost decreases by 80%, response times decrease, resource usage is optimized
      </Card>

      <Card title="Timeout Values Optimization" icon="clock">
        **Recommendation:** Measure real network latency, adjust timeout values accordingly, avoid very low or very high timeouts.\
        **Effect:** Unnecessary waits are prevented, fast fail-over is provided, user experience improves
      </Card>

      <Card title="Connection Monitoring" icon="chart-bar">
        **Recommendation:** Monitor Connection pool usage, track timeout rates, perform connection health check, set up alerting.\
        **Effect:** Problems are detected proactively, performance bottlenecks are identified early, downtime decreases
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Email Not Delivered">
    <Warning>
      Wrong `from` domain, SMTP provider blocked, or TLS may be mandatory but disabled.
    </Warning>

    <Steps>
      <Step title="DNS/SPF Check">
        Verify DNS/SPF records.
      </Step>

      <Step title="Provider Logs">
        Check provider logs.
      </Step>

      <Step title="Enable STARTTLS">
        Open **Enable STARTTLS** toggle and test again.
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Test Mail Failed">
    <Warning>
      `addressToTest` may be invalid, Auth information may be wrong, or SMTP port may be closed in firewall.
    </Warning>

    <Steps>
      <Step title="Test Address">
        Update test address.
      </Step>

      <Step title="Credential Check">
        Re-enter credentials.
      </Step>

      <Step title="Port Check">
        Verify port opening from network team.
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Connection Timeout">
    <Warning>
      Network delay, target system responding slowly, or timeout value may be too low.
    </Warning>

    <Steps>
      <Step title="Network Check">
        Check network connectivity.
      </Step>

      <Step title="System Health">
        Check target system health.
      </Step>

      <Step title="Timeout Settings">
        Increase timeout values.
      </Step>

      <Step title="Log Review">
        Review Connection logs.
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Authentication Failed">
    <Warning>
      Wrong username/password, expired credentials, or permission problem may exist.
    </Warning>

    <Steps>
      <Step title="Credentials">
        Verify credentials.
      </Step>

      <Step title="User Status">
        Check that user is active in target system.
      </Step>

      <Step title="Permission Check">
        Check that necessary permissions are granted.
      </Step>

      <Step title="Certificate Check">
        Check SSL/TLS certificates.
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Pool Exhausted">
    <Warning>
      Pool size may be too low, connection leak may exist, or traffic may be too high.
    </Warning>

    <Steps>
      <Step title="Pool Size">
        Increase pool size.
      </Step>

      <Step title="Connection Check">
        Check that connections are properly closed.
      </Step>

      <Step title="Idle Timeout">
        Set idle connection timeouts.
      </Step>

      <Step title="Metric Monitoring">
        Monitor Connection usage metrics.
      </Step>
    </Steps>
  </Accordion>

  <Accordion title="Connection Test Successful But Integration Flow Gives Error">
    <Warning>
      Different connection may be selected in Integration/Connector step, step may be incorrectly configured, or Flow/Job may not have been redeployed.
    </Warning>

    <Steps>
      <Step title="Enable Toggle">
        Check that Connection's enable toggle is active.
      </Step>

      <Step title="Connection Selection">
        Verify that correct connection is selected in Integration Flow.
      </Step>

      <Step title="Connection Deploy">
        Redeploy Connection.
      </Step>

      <Step title="Flow/Job Deploy">
        Redeploy Integration Flow or Job.
      </Step>

      <Step title="Log Check">
        Check Gateway logs.
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

## Frequently Asked Questions (FAQ)

<AccordionGroup>
  <Accordion title="Can I keep multiple sender addresses in Email Connection?">
    <Info>
      Single Connection can carry single `from` address; create separate Connection by cloning for different addresses or use application-level override.
    </Info>
  </Accordion>

  <Accordion title="Will there be a problem if I enable TLS in provider where STARTTLS is not mandatory?">
    <Info>
      Most SMTP servers support STARTTLS command, if not supported you will get error at handshake stage; in this case close toggle.
    </Info>
  </Accordion>

  <Accordion title="Which key/values can I add to Additional Properties field?">
    <Info>
      Provider's JavaMail compatible parameters (`mail.smtp.connectiontimeout`, `mail.smtp.auth.mechanisms`, etc.) are supported; key and value are free text.
    </Info>
  </Accordion>

  <Accordion title="Does mail go to real recipients with Test Connection?">
    <Info>
      No, only single mail is sent to address entered in `addressToTest` field; Integration Flow is not triggered.
    </Info>
  </Accordion>

  <Accordion title="Can I use this Connection in connector mode as well?">
    <Check>
      Yes, when `connectorMode` is activated from connector screen, same form is used and your saved Connection appears in list.
    </Check>
  </Accordion>

  <Accordion title="Can I use the same connection in multiple Integration Flows?">
    <Check>
      Yes, the same connection can be used in multiple Integration Flow or Connector steps. This provides central management and guarantees configuration consistency. However, care should be taken as changes made to connection will affect all usage locations.
    </Check>
  </Accordion>

  <Accordion title="Is using Connection pool mandatory?">
    <Info>
      Connection pool usage is not mandatory but strongly recommended in high-traffic systems. Reusing existing connections instead of opening new connection on each request significantly increases performance.
    </Info>
  </Accordion>

  <Accordion title="Should I create different connections for Test and Production?">
    <Check>
      Yes, it is recommended that you create separate connection for each environment. Alternatively, you can manage all environments within a single connection using environment parameter. This approach provides easier management and less error risk.
    </Check>
  </Accordion>

  <Accordion title="Test Connection successful but not working in Integration Flow, why?">
    <Warning>
      Several reasons may exist:
    </Warning>

    1. Connection enable toggle may be passive
    2. Different connection may be selected in Integration step
    3. Connection may not have been deployed
    4. Integration Flow may not have been redeployed yet
  </Accordion>
</AccordionGroup>
