-
Sign up for a free account at https://ethereal.email/
- This service provides temporary email addresses for testing
- No credit card required
- Provides real SMTP credentials that work for testing
-
Get your SMTP credentials
- After signing up, you'll receive an email with your test account credentials
- Or log in to your account and go to the "SMTP & API" section
-
Create your environment file
# In your project root, create a .env file: touch .env -
Add your credentials to the .env file
SMTP_USER=your-test-email@ethereal.email SMTP_PASS=your-test-password CONTACT_EMAIL=alandanielalvarez0000@gmail.com -
Restart your development server
pnpm run dev
- Enable 2-factor authentication on your Google account
- Generate an App Password:
- Go to Google Account Settings
- Select "Mail" and your device
- Copy the 16-character generated password
- Use these settings in your .env file:
SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_SECURE=false SMTP_USER=your-gmail@gmail.com SMTP_PASS=your-16-character-app-password CONTACT_EMAIL=alandanielalvarez0000@gmail.com
- Sign up at https://mailtrap.io/
- Use development SMTP settings from your inbox
SMTP_HOST=smtp.mailtrap.io
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-username
SMTP_PASS=your-password
CONTACT_EMAIL=alandanielalvarez0000@gmail.com
SMTP_HOST=smtp-mail.outlook.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-email@outlook.com
SMTP_PASS=your-password
CONTACT_EMAIL=alandanielalvarez0000@gmail.com
For production use, consider these services with free tiers:
- SendGrid: 100 emails/day free forever
- Mailgun: 10,000 emails/month free for first 3 months
- Amazon SES: 62,000 emails/month free for first year (requires AWS account)
To use these in production:
- Sign up for the service
- Verify your sending domain
- Update your .env file with the appropriate SMTP settings
- Remember to never commit your .env file to version control
- Make sure your .env file is named
.envand not.env.txtor similar - Ensure your .env file is in the project root directory
- Restart your development server after adding environment variables
- Check that your .gitignore file includes
.envto prevent committing credentials
After configuring your SMTP service:
- Start your development server:
pnpm run dev - Go to http://localhost:4321/contact
- Fill out the contact form with test data
- Submit the form and check for success message
- Check your receiving email (or Ethereal inbox) for the message