Prompt
How to send email from your app without SMTP
Latest observation
Yes. You don't need SMTP to send email from an app. The usual modern approach is to use an email-sending HTTP API.
For example, with Resend, your app makes an HTTPS request to their API, and Resend handles the actual email delivery. Their API supports Node.js, Python, PHP, Go, Java, .NET, REST, and more. Resend+1
Architecture
Your app
│
│ HTTPS + API key
▼
Email provider (e.g. Resend)
│
│ Email delivery infrastructure
▼
Recipient's Gmail / Outlook / etc.
Example: Node.js
Install the SDK:
npm install resend
Then:
import { Resend } from "resend";
const resend = new Resend(process.env.RESEND_API_KEY);
const { data, error } = await resend.emails.send({
from: "My App <hello@mydomain.com>",
to: ["user@example.com"],
subject: "Welcome!",
html: "<h1>Welcome to my app</h1><p>Thanks for signing up.</p>",
});
if (error) {
console.error(error);
}
This is an API call—not an SMTP connection. Resend's documentation shows the same pattern and also supports direct REST calls if you don't want an SDK. Resend+1
Important: don't put the API key in your frontend
For a web/mobile app, use:
Frontend
↓
Your backend / serverless function
↓
Email API
Never expose RESEND_API_KEY in browser JavaScript or a mobile app, because users could extract it and send mail using your account.
Other options
You can use the same API-based approach with:
- Postmark — particularly good for transactional email; it provides an HTTP
/emailendpoint. Postmark+1 - SendGrid — provides a REST Mail Send API authenticated with an API key. Twilio
- Resend — very simple developer-oriented API and SDKs. Resend
If you tell me what your app is built with (React/Next.js, Flutter, React Native, Laravel, Django, Spring Boot, etc.), I can show you the exact implementation without SMTP.
Citations
- https://resend.com/features/email-api
- https://www.resend.com/
- https://resend.com/deno
- https://postmarkapp.com/developer/user-guide/send-email-with-api
- https://postmarkapp.com/developer/api/email-api
- https://www.twilio.com/docs/sendgrid/api-reference/mail-send
- https://resend.com/changelog/share-email-api
- https://resend.com/changelog/mcp
- https://www.resend.com/changelog/cli
- https://resend.com/changelog/in-app-docs
- https://postmarkapp.com/developer/user-guide/send-email-with-api/send-a-single-email
- https://www.postmarkapp.com/developer/api/overview