Free email configuration tool for React applications
Generate a complete PHP backend and React hook for sending emails from your forms. No external dependencies, no monthly fees, works with any hosting provider's SMTP.
- 🆓 100% Free - No paid services required
- 🔒 Secure - Token authentication, rate limiting, honeypot anti-bot
- 🌍 Multilingual - English, Italian, Spanish, French
- ⚡ Zero Dependencies - Pure PHP backend, no composer packages
- 📧 HTML Emails - Beautiful responsive email templates
- 🎯 30+ Presets - Quick configuration for popular hosting providers
- 🔐 Privacy First - Runs 100% in your browser, no data sent anywhere
- Open the tool at alfredo-villa.github.io/react-mailer
- Select your hosting provider or enter SMTP details manually
- Fill in your domain and recipient email
- Download the generated files (mailer.php, mailer-config.php, useMailer.js)
- Upload PHP files to your server's
/api/folder - Use the React hook in your components
| File | Description |
|---|---|
mailer.php |
PHP backend (~200 lines) - handles SMTP sending |
mailer-config.php |
Configuration with your credentials |
useMailer.js |
React hook for easy integration |
README.md |
Quick start guide with your settings |
.env.example |
Environment variables template |
import { useMailer } from './hooks/useMailer';
function ContactForm() {
const { sendEmail, loading, error, success } = useMailer(
'https://yourdomain.com/api/mailer.php',
'YOUR_GENERATED_TOKEN'
);
const handleSubmit = async (e) => {
e.preventDefault();
await sendEmail({
fields: {
email: 'user@example.com',
message: 'Hello!',
website: '' // honeypot field
}
});
};
return (
<form onSubmit={handleSubmit}>
{/* Your form fields */}
<button disabled={loading}>
{loading ? 'Sending...' : 'Send'}
</button>
{error && <p className="error">{error}</p>}
{success && <p className="success">Sent!</p>}
</form>
);
}Aruba, IONOS, OVH, Hetzner, Strato, Infomaniak, Register.it, Netsons
GoDaddy, Bluehost, HostGator, DreamHost, Namecheap, A2 Hosting, InMotion
SiteGround, Hostinger, Cloudways, cPanel, Plesk
Gmail, Outlook/O365, Yahoo, Zoho Mail, SendGrid, Mailgun, Amazon SES, Postmark
| Feature | Description |
|---|---|
| Token Auth | Every request requires a secret token |
| Rate Limiting | 5 emails/hour per IP (configurable) |
| Honeypot | Hidden field to catch bots |
| CORS | Only allowed domains can send requests |
| Input Validation | Email format and required fields |
| Logging | All attempts are logged with IP |
Works in all modern browsers:
- Chrome, Firefox, Safari, Edge (latest versions)
- No server-side processing - everything runs locally in your browser
MIT License - Free for personal and commercial use.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Add more hosting presets
- Improve translations
If this tool saved you time, consider buying me a coffee:
Alfredo Villa
- GitHub: @alfredovilla
Made with ❤️ for the developer community