1.0.1 • Published 2 months ago
cf-send-email-worker v1.0.1
Free Sending Email Api Service
A private api service for sending email powered by Cloudflare worker project.
Prepare Job
- Prepare a domian, such as
formtome.com
. Now, add a website in cloudflare-dashboard and build your domain. It maybe cost you about 30min. - Select your site and domain, Enable Email Routing. It maybe cost you about 5min.
- Install warngler for delpoy cf worker. Ensure your node version >= 16.13.0 and run :
npm install wrangler@latest -g
Setup
- Get the code
git clone git@github.com:maojindao55/cf-send-email-worker.git
- 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.
- Deploy your worker
wrangler deploy --name send-email-worker-api
API Documentation
Endpoint
http://{{your-cf-worker-prefix}}.workers.dev/
Method
POST
Parameters
Name | Type | Description |
---|---|---|
sender_email | string | The email address of the sender. |
sender_name | string | The name of the sender. |
recipient_email | string | The email address of the recipient. |
subject | string | The subject of the email. |
msg_data | string | The 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