Email Setup

Types of Email Your App Sends

20 دقيقة

Web apps send email constantly: verification links, password resets, receipts, notifications and newsletters. Getting it into inboxes reliably is a skill of its own.

Two kinds of email

Transactional Marketing / bulk
Triggered by a user action (sign-up, purchase) you (campaigns, newsletters)
Examples verify email, reset password, receipt product updates, promotions
Consent expected as part of the service needs opt-in and an unsubscribe link
Urgency seconds matter can be scheduled

Keep them separate (different subdomains or streams), so a marketing complaint spike never delays password resets.

Use an email provider

Do not send directly from your web server: new servers have no reputation, and port 25 is often blocked. Use a provider with an API:

Provider Known for
Resend developer-friendly API, React/HTML emails
Postmark fast, highly reliable transactional delivery
SendGrid / Mailgun / Amazon SES high volume, lower cost at scale
Mailchimp / Buttondown / ConvertKit newsletters and marketing

Compare free tiers, price per thousand emails, deliverability tools and whether marketing sending is allowed on the plan.

What you need before sending

  1. A domain you control (send from a subdomain such as mail.yourdomain.com).
  2. SPF, DKIM and DMARC records (see Domains & DNS).
  3. An API key stored as an environment variable.
  4. A real "from" address, and a monitored reply-to address.

Check yourself

  • Why separate transactional and marketing email?
  • Why not send email directly from your web server?
  • What DNS records are required before sending?

يُحفظ تقدّمك في هذا المتصفح فقط.

إرسال للمراجعة (10 نقطة)