File contents Send Email
Description
Compose and send a plain-text or HTML email via SMTP.
When to Use
Automated notification workflows
Agent needs to send a report or alert
When NOT to Use
Mass mailing (use dedicated email service with unsubscribe handling)
Sending sensitive data — prefer secure channels
Inputs
Name
Type
Required
Description
to
list
yes
Recipient email addresses
subject
string
yes
Email subject
body
string
yes
Plain text body
html_body
string
no
HTML version of body
smtp_host
string
yes
SMTP server
smtp_port
int
no
Default 587
username
string
yes
SMTP username
password
string
yes
SMTP password (use env var)
Example
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import os
def send_email(to: list, subject: str, body: str, html_body: str = None) -> bool:
smtp_host = os.environ["SMTP_HOST"]
smtp_port = int(os.environ.get("SMTP_PORT", 587))
username = os.environ["SMTP_USER"]
password = os.environ["SMTP_PASS"]
msg = MIMEMultipart("alternative")
msg["From"] = username
msg["To"] = ", ".join(to)
msg["Subject"] = subject
msg.attach(MIMEText(body, "plain"))
if html_body:
msg.attach(MIMEText(html_body, "html"))
with smtplib.SMTP(smtp_host, smtp_port) as server:
server.starttls()
server.login(username, password)
server.sendmail(username, to, msg.as_string())
return True
# send_email(["alice@example.com"], "Report Ready", "Your weekly report is attached.")
Security Notes
Never hardcode credentials. Use environment variables or a secrets manager.
Validate recipient addresses to prevent injection.
Log sent emails for audit trail.
1 --- 2 name: send-email 3 description: Send Email 4 --- 5 6 # Send Email 7 8 ## Description 9 10 Compose and send a plain-text or HTML email via SMTP. 11 12 ## When to Use 13 14 - Automated notification workflows 15 - Agent needs to send a report or alert 16 17 ## When NOT to Use 18 19 - Mass mailing (use dedicated email service with unsubscribe handling) 20 - Sending sensitive data — prefer secure channels 21 22 ## Inputs 23 24 | Name | Type | Required | Description | 25 |------|------|---------|-------------| 26 | to | list | yes | Recipient email addresses | 27 | subject | string | yes | Email subject | 28 | body | string | yes | Plain text body | 29 | html_body | string | no | HTML version of body | 30 | smtp_host | string | yes | SMTP server | 31 | smtp_port | int | no | Default 587 | 32 | username | string | yes | SMTP username | 33 | password | string | yes | SMTP password (use env var) | 34 35 ## Example 36 37 ```python 38 import smtplib 39 from email.mime.multipart import MIMEMultipart 40 from email.mime.text import MIMEText 41 import os 42 43 def send_email(to: list, subject: str, body: str, html_body: str = None) -> bool: 44 smtp_host = os.environ["SMTP_HOST"] 45 smtp_port = int(os.environ.get("SMTP_PORT", 587)) 46 username = os.environ["SMTP_USER"] 47 password = os.environ["SMTP_PASS"] 48 49 msg = MIMEMultipart("alternative") 50 msg["From"] = username 51 msg["To"] = ", ".join(to) 52 msg["Subject"] = subject 53 msg.attach(MIMEText(body, "plain")) 54 if html_body: 55 msg.attach(MIMEText(html_body, "html")) 56 57 with smtplib.SMTP(smtp_host, smtp_port) as server: 58 server.starttls() 59 server.login(username, password) 60 server.sendmail(username, to, msg.as_string()) 61 return True 62 63 # send_email(["alice@example.com"], "Report Ready", "Your weekly report is attached.") 64 ``` 65 66 ## Security Notes 67 68 - Never hardcode credentials. Use environment variables or a secrets manager. 69 - Validate recipient addresses to prevent injection. 70 - Log sent emails for audit trail.
ashish993/AI-Agent-Skills-Library/tree/main/skills/send-email commit 9cd7053974
Frequently asked questions How do I install the Send Email skill? Run npx skillmds@latest add ashish993/send-email in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Send Email skill do? Send Email It is listed under Productivity on SkillMD.
Is Send Email safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Send Email? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Send Email free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Send Email? ashish993 (@ashish993) published this skill. Their other Agent Skills are listed on their SkillMD profile.