1.2 KiB
1.2 KiB
Support Email Site
A Next.js contact form with shadcn-ui that sends emails via SMTP.
Setup
- Install dependencies:
npm install
- Copy
.env.exampleto.env.local:
cp .env.example .env.local
- Configure your SMTP settings in
.env.local:
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER=your-email@example.com
SMTP_PASSWORD=your-smtp-password
SMTP_FROM=your-email@example.com
- Run the development server:
npm run dev
- Open http://localhost:3000 in your browser.
Features
- Contact form with name, email, and message fields
- Server-side email sending via SMTP
- Form validation
- Loading states and error handling
- Built with Next.js 16 and shadcn-ui
- Responsive design
SMTP Configuration
SMTP_HOST: Your SMTP server hostnameSMTP_PORT: SMTP port (typically 587 for TLS, 465 for SSL, or 25)SMTP_SECURE: Set totruefor SSL (port 465),falsefor TLS (port 587)SMTP_USER: Your SMTP username/emailSMTP_PASSWORD: Your SMTP passwordSMTP_FROM: The email address to send from (defaults to SMTP_USER if not set)
Build
npm run build
Lint
npm run lint