Skip to main content

ai12z Copilot: Email Sending Agent

Overview

The Email Sending Agent is an out-of-the-box tool within the ai12z Copilot suite that allows you to send emails to multiple recipients directly from your copilot. This agent simplifies the process of integrating email functionalities, supporting both the ai12z email provider and custom email providers (such as Gmail, Outlook, or your own SMTP server). With straightforward configuration and minimal setup, you can enhance your applications by adding email capabilities without extensive development effort.

Key Features

  • Multiple Recipients: Send emails to one or more recipients in a single operation.
  • HTML Email Support: Compose rich emails using HTML for better formatting and presentation.
  • Custom Email Providers: Configure and use your own email providers, including popular services like Gmail and Outlook.
  • Easy Integration: As an out-of-the-box agent, it requires no customization accept connecting to your email service

Purpose

The agent is designed to:

  • Enhance Communication: Enable your copilot to send notifications, alerts, newsletters, or any email communication to users.
  • Simplify Integration: Eliminate the need for complex SMTP configurations and email handling code.
  • Save Time: Automate the process of sending emails, allowing you to focus on your copilot features.

How It Works

  1. Email Configuration: Set up your email provider settings within the ai12z Copilot platform. You can use the default ai12z email provider or configure a custom SMTP server.
  2. Input Parameters: The LLM will Provide the recipients, subject, and HTML body content for the email.
  3. Email Sending: The agent sends the email using the configured email provider settings.

Email Provider Configuration

Using ai12z as Email Provider

By default, the agent uses the ai12z email provider, which requires minimal setup. If you prefer to use this option, you can skip the custom provider configuration.

Configuring a Custom Email Provider

You should use your own email provider, (e.g., Gmail, Outlook, or a custom SMTP server), as the ai12z is used for prototyping your application. Follow these steps:

  1. Access Email Settings:

    • Navigate to your ai12z Copilot portal.
    • Go to Project Settings.
    • Select the Email tab to configure your email provider.
  2. Fields to Configure:

email configuration screen

  • Email Provider: Choose Custom or select a pre-configured provider if available.
  • Server: Enter your SMTP server address.
    • Gmail: smtp.gmail.com
    • Outlook: smtp.office365.com
    • Custom Server: Your SMTP server domain (e.g., smtp.yourdomain.com)
  • fromEmail: Specify the email address you want to send emails from.
  • Port: Enter the SMTP port number.
    • Common ports:
      • 587 for TLS
      • 465 for SSL
      • 25 for non-encrypted connections
  • Use Secure Connection: Check this box if your provider requires a secure connection (TLS/SSL).
  • UserName: Your email account username (typically your email address).
  • Password: The password for your email account.
  1. Saving the Settings:

    • Click Save to apply your settings.
    • Ensure your credentials and server details are correct to enable successful email sending.
  2. Testing the Configuration:

    • Send a test email to verify that the settings work correctly.
    • Navigate to the test email section under the email settings or trigger an action that sends an email.

Example Configurations

Gmail Setup:

  • Server: smtp.gmail.com
  • Port: 587
  • Use Secure Connection: Checked (TLS)
  • UserName: Your Gmail email address (e.g., youremail@gmail.com)
  • Password: Your Gmail password (consider using an app-specific password if 2-step verification is enabled)

Outlook Setup:

  • Server: smtp.office365.com
  • Port: 587
  • Use Secure Connection: Checked (TLS)
  • UserName: Your Outlook email address (e.g., youremail@outlook.com)
  • Password: Your Outlook password

Custom Server Setup:

  • Server: Your custom SMTP server (e.g., smtp.yourdomain.com)
  • Port: Based on your server settings (usually 587 or 465)
  • Use Secure Connection: Depends on your server configuration
  • UserName: Your email address or username
  • Password: Your email account password

Parameters

When invoking the Email Sending Agent, you can specify the following parameters:

  • recipient (array of strings, required): A list of email addresses to send the email to. For example: ["user1@example.com", "user2@example.com"].

  • subject (string, required): The subject line of the email.

  • body_html (string, required): The HTML content of the email body. Allows for rich text formatting and inclusion of images, links, and other HTML elements.

Enabling the Agent

To enable the Email Sending Agent in your ai12z Copilot:

  1. Access the Agent Settings:

    • Log in to your ai12z Copilot dashboard.
    • Navigate to the Agents section.
  2. Locate the Agent:

    • Find the Email Sending agent in the list of available agents.
  3. Enable the Agent:

    • Click on the agent and select Enable to activate it for your projects.
  4. Configure Email Provider:

    • Follow the Email Provider Configuration steps outlined above to set up your email settings.
  5. Set Parameters:

    • When using the agent, specify the recipient, subject, and body_html parameters as needed for your application.

Usage Example

Sending an Email to Multiple Recipients, the LLM sends to the agent

{
"function": "send_users_email",
"parameters": {
"recipient": ["user1@example.com", "user2@example.com"],
"subject": "Welcome to Our Service",
"body_html": "<h1>Welcome!</h1><p>Thank you for joining our service.</p>"
}
}

In this example, the agent will:

  • Send an email with the subject "Welcome to Our Service" to user1@example.com and user2@example.com.
  • Use the provided HTML content as the email body.
  • Return a success message upon successful sending.

Benefits

  • Enhanced Communication: Streamline communication with users directly from your application.
  • Time Savings: Reduce development time by leveraging a ready-made email solution.
  • Improved Functionality: Add email notifications, alerts, and other communication features without extensive coding.

Limitations

  • Email Provider Restrictions: Some email providers may have sending limits or require additional authentication steps (e.g., app-specific passwords for Gmail).
  • Non-Customizable: This is an out-of-the-box agent with fixed functionality and cannot be customized.
  • Spam Compliance: Ensure that your use of this agent complies with anti-spam laws and regulations (e.g., CAN-SPAM Act).

Troubleshooting

If emails are not being sent, consider the following:

  • Check Configuration: Ensure that the SMTP server, port, and credentials are correctly configured. Click Test Email verify you receive an email
  • Secure Connection: Verify that the secure connection settings match your provider's requirements (TLS/SSL).
  • Firewall and Network Settings: Ensure that your network allows SMTP connections to the specified server and port.
  • Provider Limitations: Check if your email provider imposes any sending limits or requires additional setup.

Support

If you need assistance or have questions about the agent:

  • Documentation: Refer to the ai12z Copilot documentation for more detailed information.
  • Contact Us: Reach out to our support team at support@ai12z.com for personalized help.

By enabling the Email Sending Agent, you can effortlessly integrate email communication capabilities into your applications, enhancing user engagement and streamlining interactions—all with minimal effort and cost.