Skip to main content

Sending Emails

Mailofly provides a robust, scalable infrastructure for sending transactional emails and system notifications. Whether sending verification codes, invoices, weekly digests, or alert notifications, Mailofly handles delivery with built-in DKIM signing, automatic rate limiting, and real-time delivery telemetry.

Sending Methods

You can send emails using any of the following interfaces:
  1. REST API (POST /api/emails): Send emails over HTTP using cURL or your preferred HTTP client.
  2. Official SDKs: Native, strongly-typed libraries for TypeScript/Node.js, Python, PHP, Go, and Dart.
  3. SMTP Gateway: Connect any standard SMTP client or framework (Nodemailer, Laravel, PHPMailer, Supabase) via smtp.mailofly.com:587.
  4. AI MCP Server: Enable AI coding assistants and autonomous agents to trigger sends with natural language.

Anatomy of a Send Request

A basic send request requires:
  • from: Sender address with your verified domain (e.g. Acme <alerts@acme.com>).
  • to: One or more recipient email addresses.
  • subject: Subject line of the email.
  • html or text: Content of the email (or a template_id).
Optional features:
  • attachments: Files or inline assets.
  • scheduled_at: ISO-8601 timestamp for future delivery.
  • headers: Custom headers (e.g. In-Reply-To, List-Unsubscribe).
  • tags: Key-value pairs for filtering in analytics.

Next Steps

Related topics

Introduction