Skip to content

Instantly share code, notes, and snippets.

@anikwai
Created November 4, 2025 05:31
Show Gist options
  • Select an option

  • Save anikwai/a2fbaabc7b5a039574bde5e0977016a0 to your computer and use it in GitHub Desktop.

Select an option

Save anikwai/a2fbaabc7b5a039574bde5e0977016a0 to your computer and use it in GitHub Desktop.
Resend Attachment Implementation

import os import resend from dotenv import load_dotenv

load_dotenv()

resend.api_key = os.environ["RESEND_API_KEY"]

f: bytes = open( os.path.join(os.path.dirname(file), "Daily Performance Report (July 25, 2025).xlsx"), "rb" ).read()

attachment:resend.Attachment = { "content": list(f), "filename": "Daily Performance Report.xlsx", }

params = { "from": "Autorep noreply@autorep.ourtelekom.com.sb", "to": ["anikwai.w@gmail.com"], "subject": "Hello world", "html": "It works!", "attachments": [attachment], }

resend.Emails.send(params)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment