1.0.1 • Published 2 months ago

cf-send-email-worker v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

English / 中文版

Free Sending Email Api Service

A private api service for sending email powered by Cloudflare worker project.

Prepare Job

  1. Prepare a domian, such as formtome.com. Now, add a website in cloudflare-dashboard and build your domain. It maybe cost you about 30min.
  2. Select your site and domain, Enable Email Routing. It maybe cost you about 5min.
  3. Install warngler for delpoy cf worker. Ensure your node version >= 16.13.0 and run :
npm install wrangler@latest -g

Setup

  1. Get the code
git clone git@github.com:maojindao55/cf-send-email-worker.git
  1. Custom wrangler.toml
name = "send-email-api" 
main = "./index.js" 
compatibility_date = "2022-05-03"
[[send_email]]
type = "send_email"
name = "SEB"
allowed_destination_addresses = ["your-dest@example.com"] 
# Here, replace your verified email address.
  1. Deploy your worker
wrangler deploy  --name send-email-worker-api

API Documentation

Endpoint

http://{{your-cf-worker-prefix}}.workers.dev/

Method

POST

Parameters

NameTypeDescription
sender_emailstringThe email address of the sender.
sender_namestringThe name of the sender.
recipient_emailstringThe email address of the recipient.
subjectstringThe subject of the email.
msg_datastringThe message body of the email.

Example Request

curl -d"sender_email=admin@yourdomain.com&sender_name=FromWorker&recipient_email=your-dest@example.com&subject='Hello Guy!'&msg_data='My first email sent!'" "http://send-email-worker-api.workers.dev/"
1.0.1

2 months ago