smtp-email

Send emails with attachments via Python smtplib and Gmail SMTP.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/decniner/HermesP1 --skill smtp-email-decniner
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: smtp-email
Source: https://github.com/decniner/HermesP1/tree/main/.hermes-backup/skills/productivity/smtp-email
Command: npx skills add https://github.com/decniner/HermesP1 --skill smtp-email-decniner

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve? When the Himalaya CLI is not installed, you still need a way to send emails programmatically. This Skill uses Python's built-in smtplib to send plain text, HTML, and attachment-bearing emails through Gmail SMTP on any platform without extra dependencies. ## Core Features & Use Cases - Plain Text & Attachment Sending: Send emails with file attachments using MIMEMultipart and base64 encoding via smtp.gmail.com on port 587 with STARTTLS. - Inline HTML Images: Embed charts or images directly in the email body using MIMEImage with Content-ID references and multipart/related structure. - Gmail App Password Flow: Guides app password generation, credential lookup from memory or local scripts, and troubleshooting of common SMTP errors like 535 auth failures. - Use Case: Generate a chart image, write an HTML report referencing it via cid:, and email the rich report to a recipient โ€” all in one scripted workflow. ## Quick Start Send an email with the generated report.html file attached to recipient@gmail.com using my Gmail account via Python smtplib.

Frequently Asked Questions about smtp-email

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send an email with an attachment in Python?โ–ผ

Use smtplib with MIMEMultipart: attach the body with MIMEText, then read the file in binary mode, wrap it in MIMEBase, encode with base64, and set the Content-Disposition attachment header. Connect to smtp.gmail.com on port 587 with STARTTLS and call send_message.

How to embed an image inline in an HTML email with Python?โ–ผ

Build a MIMEMultipart('related') message, attach the HTML body referencing the image as src="cid:chart01", then attach a MIMEImage with a Content-ID header of <chart01>. The HTML cid value omits the angle brackets while the header includes them.

Why does Gmail SMTP reject my password with a 535 error?โ–ผ

Gmail blocks regular account passwords for SMTP; you must generate a 16-character app password at myaccount.google.com/apppasswords, which requires 2FA enabled. Pass the full string including spaces, and ensure the From address matches the login account.

Can I use smtplib without installing any Python packages?โ–ผ

Yes, smtplib and the email.mime modules are part of the Python 3 standard library, so no pip install is needed. This makes it work on Windows, macOS, and Linux out of the box.

What are the limitations of sending email through Gmail SMTP?โ–ผ

Gmail rejects attachments larger than 25MB and enforces rate limits of roughly 100 recipients per day. Messages may also be filtered as spam depending on content, even when the SMTP session completes without errors.