This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
このプロジェクトは、Resendを使用したお問い合わせフォームのメール送信機能を搭載しています。
- 月3,000通まで無料
- 高い配信率と信頼性
- 開発者フレンドリーなAPI
- 簡単な設定
- 詳細な分析機能
- https://resend.com/signup にアクセス
- メールアドレスとパスワードでアカウント作成
- または GitHub/Google アカウントでサインアップ
- Resendダッシュボードにログイン
- 左メニューの「API Keys」をクリック
- 「Create API Key」ボタンをクリック
- 名前を入力(例:
angle-cs-contact-form) - 「Full access」を選択
- 「Add」をクリック
- 表示されたAPI キー(
re_で始まる文字列)をコピー
プロジェクトルートに .env.local ファイルを作成し、以下を設定:
# 必須: メールの送信先アドレス
TO_EMAIL=your-email@example.com
# 必須: Resend API キー
RESEND_API_KEY=re_xxxxxxxxxxxxxxxxxxxxxxxxxx
# オプション: 送信者メールアドレス(独自ドメイン使用時)
FROM_EMAIL=contact@yourdomain.com
# オプション: ドメイン名
DOMAIN=yourdomain.com独自ドメインを使用する場合:
- Resendダッシュボードで「Domains」をクリック
- 「Add Domain」で独自ドメインを追加
- DNS設定を行う:
- SPF レコード:
v=spf1 include:_spf.resend.com ~all - DKIM レコード: Resendが提供する値を設定
- DMARC レコード:
v=DMARC1; p=none;
- SPF レコード:
Cloudflare Pagesの管理画面で以下を設定:
- プロジェクトの「Settings」→「Environment variables」
- 以下の変数を追加:
TO_EMAIL: あなたのメールアドレスRESEND_API_KEY: ResendのAPI キーFROM_EMAIL: 送信者アドレス(オプション)DOMAIN: ドメイン名(オプション)
- Build command:
npm run build - Build output directory:
.next - Root directory:
/
- 開発サーバーを起動:
npm run dev - お問い合わせフォームに入力して送信
- コンソールにメール内容が出力されることを確認
- Cloudflare Pagesにデプロイ
- 環境変数を設定
- お問い合わせフォームからテスト送信
- 指定したメールアドレスにメールが届くことを確認
-
API キーエラー
- API キーが正しく設定されているか確認
re_で始まる文字列であることを確認
-
メールが届かない
- 迷惑メールフォルダを確認
- FROM_EMAILのドメインが認証済みか確認
-
送信エラー
- Resendダッシュボードのログを確認
- 環境変数が正しく設定されているか確認
- 無料プラン: 月3,000通まで
- Pro プラン: $20/月で月50,000通まで
- 一般的なお問い合わせフォームなら無料プランで十分です
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
このプロジェクトはCloudflare Pagesでのデプロイに最適化されています。
- Cloudflare Pagesにプロジェクトを接続
- ビルド設定:
- Build command:
npm run build - Build output directory:
.next
- Build command:
- 環境変数を設定
- デプロイ
Check out our Next.js deployment documentation for more details.