SMS sender using EdgeOne Pages Edge Functions (Node.js port of the original PHP SMS library).
cd nodejs-sms
npm installThis version uses Resend for sending emails to carrier gateways.
- Sign up at https://resend.com (free tier available)
- Get your API key from the dashboard
- Verify your sender email domain in Resend
Create a .env.local file:
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxx
Or set it in EdgeOne Pages dashboard under Settings → Environment Variables.
- Go to Resend Domains
- Click "Add Domain"
- Enter:
sypnaticwars.com - Add the DNS records Resend provides to your domain
- Wait for verification (5-30 minutes)
Note: Messages will be sent from SMS <noreply@sypnaticwars.com>. The sender's email is added as a Reply-To header.
# Login to EdgeOne
npx @edgeone/pages login
# Deploy
npx @edgeone/pages deployOr connect your Git repo to EdgeOne Pages for automatic deployments.
- Open your deployed site (e.g.,
https://your-project.edgeone.app) - Fill in the form:
- Phone Number: 10-digit US number (e.g.,
4234881795) - Carrier: Select from dropdown (e.g.,
att) - Sender Email: Your email (e.g.,
Biggysize21@gmail.com) - Message: Up to 160 characters
- Phone Number: 10-digit US number (e.g.,
- Click "Send Message"
curl -X POST https://your-project.edgeone.app/api/send-sms \
-H "Content-Type: application/json" \
-d '{
"senderEmail": "Biggysize21@gmail.com",
"message": "Text me on chat app for peace talk sweetie i am waiting on u right there.",
"phoneNumber": "4234881795",
"carrier": "att"
}'Success:
{
"success": true,
"errors": [],
"messageId": "msg_xxxxxxxxxxxxx"
}Error:
{
"success": false,
"errors": [
"Phone number must be exactly 10 digits",
"Valid carrier required"
]
}Same as original PHP library:
- alltel, att, boost, cellularone, cingular, comcast
- metropcs, nextel, sprint, tmobile, tracfone
- uscellular, verizon, virginmobile, weblinkwireless
nodejs-sms/
├── edge-functions/
│ └── send-sms.js # Edge Function (API endpoint)
├── index.html # Web interface
├── package.json # Dependencies
└── README.md # This file
| Feature | PHP Version | Node.js/EdgeOne Version |
|---|---|---|
| Runtime | PHP server | EdgeOne Pages (Serverless) |
PHP mail() |
Resend API | |
| Config | None (needs SMTP) | RESEND_API_KEY env var |
| Deployment | Manual FTP | Git push or CLI |
| Scaling | Server-dependent | Auto-scales at edge |
- Set
RESEND_API_KEYin environment variables
- Verify your sender email is authenticated in Resend
- Check Resend dashboard for detailed error logs
- Verify the carrier is correct for the phone number
- Some carriers may block automated messages
- Resend: Free tier includes 100 emails/day, 3,000/month
- EdgeOne Pages: Free tier available for small projects