Attachments
Attachments let you send files such as images, logs, PDFs, and artifacts alongside your message. Whether they arrive as true attachments depends on what the destination service supports.
CLI attachments
Section titled “CLI attachments”Use --attach one or more times:
apprise -t "System Alert" -b "See attached log" \ --attach /var/log/syslog \ "mailto://user:pass@example.com"
apprise -b "Here are the files" \ --attach /tmp/photo1.jpg \ --attach /tmp/photo2.jpg \ "tgram://..."Python Attachments
Section titled “Python Attachments”Pass a single path or a list of paths via attach:
from apprise import Apprise
apobj = Apprise()apobj.add("tgram://...")
# Single attachmentapobj.notify(body="See attached", attach="/path/to/file.txt")
# Multiple attachmentsapobj.notify( body="Artifacts attached", attach=[ "/path/to/build.log", "/path/to/report.pdf", ],)Remote Attachments (URLs)
Section titled “Remote Attachments (URLs)”You can also provide a URL and Apprise will fetch it before delivering:
# Apprise will download this image and send it to the destination# if you provide a user/pass combo, it will even authenticate for you# prior to retrieving the attachmentapobj.notify( body="Security Camera Snapshot", attach="http://admin:pass@example.local/cam/snapshot.jpg")In-Memory Attachments (AttachMemory)
Section titled “In-Memory Attachments (AttachMemory)”When you generate content on the fly — rendered HTML, chart images, CSVs, PDFs — you can pass it directly as an AttachMemory object without writing anything to disk.
Pass a string or bytes directly — no temporary file is created:
import apprisefrom apprise.attachment import AttachMemory
apobj = apprise.Apprise()apobj.add("discord://webhook_id/webhook_token/")
apobj.notify( body="Today's readings are attached.", attach=AttachMemory( content="date,value\n2026-03-20,42\n2026-03-21,38\n", name="readings.csv", mimetype="text/csv", ),)str content is encoded to UTF-8 automatically. Use bytes if you already have binary data.
Generate an image with Pillow and send it without saving to disk:
import ioimport apprisefrom apprise.attachment import AttachMemoryfrom PIL import Image, ImageDraw
# Draw a simple imageimg = Image.new("RGB", (400, 200), color=(30, 30, 30))draw = ImageDraw.Draw(img)draw.text((20, 80), "Hello from Apprise!", fill=(255, 255, 0))
# Render to an in-memory bufferbuf = io.BytesIO()img.save(buf, format="PNG")
apobj = apprise.Apprise()apobj.add("tgram://bottoken/ChatID")
apobj.notify( body="Generated image attached.", attach=AttachMemory( content=buf.getvalue(), name="hello.png", mimetype="image/png", ),)Render a chart with Matplotlib and attach it directly:
import ioimport apprisefrom apprise.attachment import AttachMemoryimport matplotlib.pyplot as plt
# Build the chartfig, ax = plt.subplots()ax.plot([1, 2, 3, 4], [10, 24, 18, 32])ax.set_title("Daily metric")ax.set_xlabel("Day")ax.set_ylabel("Value")
# Render to an in-memory bufferbuf = io.BytesIO()fig.savefig(buf, format="png")plt.close(fig)
apobj = apprise.Apprise()apobj.add("tgram://bottoken/ChatID")
apobj.notify( body="Nightly trend chart attached.", attach=AttachMemory( content=buf.getvalue(), name="trend.png", mimetype="image/png", ),) Questions or Feedback?
Technical Issues
Having trouble with the code? Open an issue on GitHub: