Overview
Attachments allow you to send and receive files with your emails. Jasni supports all common file types and provides metadata about attachments when listing or reading emails.Attachment Structure
When you read an email, attachment metadata is included:| Field | Type | Description |
|---|---|---|
filename | string | Original filename |
contentType | string | MIME type (e.g., application/pdf) |
size | integer | File size in bytes |
contentId | string | Content-ID for inline attachments |
Example Response
Sending Attachments
Include attachments when sending an email:Supported File Types
Jasni supports all standard MIME types:| Category | Common Types |
|---|---|
| Documents | PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX |
| Images | PNG, JPG, GIF, SVG, WEBP |
| Archives | ZIP, RAR, 7Z, TAR, GZ |
| Text | TXT, CSV, JSON, XML, HTML |
| Media | MP3, MP4, WAV, MOV |
Size Limits
| Limit | Value |
|---|---|
| Single attachment | 25 MB |
| Total per email | 25 MB |
For larger files, consider using a file sharing service and including a link in the email.
Inline Attachments
Inline attachments (like images embedded in HTML) use thecontentId field:
cid: prefix in the HTML references the contentId of the attachment.
Working with Attachments in SDKs
TypeScript SDK
Python SDK
Best Practices
Validate file types
Validate file types
Check file types before processing attachments to avoid security risks.
Scan for malware
Scan for malware
If accepting attachments from external sources, consider scanning them for malware.
Use descriptive filenames
Use descriptive filenames
Give attachments clear, descriptive names so recipients know what they’re downloading.
Compress when possible
Compress when possible
For multiple files, consider compressing them into a single ZIP archive.