Skip to content

EmailClient

The EmailClient enables LLMs to send emails.

import os
from griptape.tools import EmailClient

email_client = EmailClient(
    smtp_host=os.environ.get("SMTP_HOST"),
    smtp_port=int(os.environ.get("SMTP_PORT", 465)),
    smtp_password=os.environ.get("SMTP_PASSWORD"),
    smtp_user=os.environ.get("FROM_EMAIL"),
    smtp_use_ssl=bool(os.environ.get("SMTP_USE_SSL")),
)

For debugging purposes, you can run a local SMTP server that the LLM can send emails to:

python -m smtpd -c DebuggingServer -n localhost:1025