Step 3: Configure your Mailtrap secrets
After Bolt.new creates your application, add these secrets in your Supabase project:
MAILTRAP_ACCOUNT_ID=your_account_id
MAILTRAP_API_KEY=your_api_key
MAILTRAP_MY_EMAIL=your-email@example.com
MAILTRAP_FROM_EMAIL=form-submissions@your-verified-domain.com
Make sure to replace the placeholder values with your actual Mailtrap credentials.
Test your Mailtrap integration with Bolt.new
Step 1: Test form submission
- Navigate to your landing page in Bolt.new Preview
- Fill out the contact form with test data
- Submit the form and verify the confirmation message displays
- Check for any error messages in the console
Step 2: Verify email delivery
- Check your inbox for the notification email
- Verify the contact appears in your Mailtrap Contacts
- Confirm the email content includes all form data
- Review the entry in yourMailtrap Email Logs
Step 3: Check database integration
- Verify the contact was saved to your Supabase contacts table
- Confirm the Mailtrap contact ID was stored in the mailtrap_contact_id column
- Check that Row-Level Security is properly configured
Bolt.new email sending best practices
Security
- Always store sensitive information in Supabase Secrets, never in code
- Enable Row-Level Security (RLS) on all database tables
- Regularly rotate your API keys
- Use environment variables for all configuration values
- Implement proper input validation to prevent injection attacks
Email deliverability
- Use a verified domain for all outgoing emails
- Monitor your sender reputation in Mailtrap analytics
- Keep your contact lists clean and up-to-date
- Implement proper SPF, DKIM, and DMARC records
- Follow email content best practices to avoid spam filters
User experience
- Provide clear feedback when forms are submitted
- Include proper validation messages with helpful guidance
- Consider adding loading states during submission
- Make forms accessible with proper ARIA labels
- Implement error handling with user-friendly messages
Performance
- Use Supabase Edge Functions for server-side logic
- Implement proper error handling and retry mechanisms
- Consider rate limiting for form submissions
- Optimize API calls to minimize response times
- Monitor performance metrics and set up alerts
Pro tips
Avoid Supabase email limits
To bypass Supabase's hourly email sending limits, configure your Supabase project's SMTP settings to use Mailtrap. Follow this integration guide for detailed instructions.
Prompt optimization
Start with basic functionality and iteratively improve your prompts. Bolt.new works best when you build features step-by-step rather than trying to create everything at once.
Error handling strategy
Always include comprehensive error handling in your Bolt.new applications. Email operations can fail for various reasons, so ensure your users receive appropriate feedback and your application handles failures gracefully.
Performance monitoring
Regularly review your Mailtrap analytics and Supabase performance metrics to identify optimization opportunities and ensure reliable email delivery.
Wrapping up
With Bolt.new and Mailtrap working together, you have a powerful foundation for building email-driven applications that can scale with your business needs. The combination of Bolt.new's rapid development capabilities and Mailtrap's reliable email infrastructure enables you to create professional email experiences quickly and efficiently.