---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://sendcorex.com/llms.txt"
---

Source: https://sendcorex.com/th/blog/strapi-email-smtp

บทเรียน

# ตั้งค่าอีเมลของ Strapi ด้วย SMTP (provider Nodemailer)

ติดตั้ง provider Nodemailer เพิ่มบล็อกการตั้งค่าหนึ่งบล็อก แล้วทดสอบจากหน้าแอดมิน

โดยทีม Sendcorex·อัปเดต 18 พ.ย. 2026·อ่าน 5 นาที

## 1. ติดตั้ง provider

```
npm install @strapi/provider-email-nodemailer
```

## 2. ตั้งค่า config/plugins.js

```
module.exports = ({ env }) => ({
  email: {
    config: {
      provider: 'nodemailer',
      providerOptions: {
        host: 'smtp.sendcorex.com',
        port: 587,
        auth: {
          user: env('SENDCOREX_API_KEY'),
          pass: env('SENDCOREX_API_KEY'),
        },
      },
      settings: {
        defaultFrom: 'Acme <hello@yourdomain.com>',
        defaultReplyTo: 'support@yourdomain.com',
      },
    },
  },
});
```

## 3. ทดสอบจากหน้าแอดมิน

รีสตาร์ต Strapi เปิด **Settings → Email → Configuration** แล้วส่งอีเมลทดสอบ อีเมลของ Users & Permissions (ยืนยัน รีเซ็ตรหัสผ่าน) ก็จะผ่าน SMTP relay ของคุณด้วย

## 4. ส่งจากโค้ดของคุณ

```
await strapi.plugin('email').service('email').send({
  to: 'user@example.com',
  subject: 'Your order is confirmed',
  text: 'Thanks for your order!',
  html: '<html><body><p>Thanks for your order!</p></body></html>',
});
```

## 5. ยืนยันโดเมน

ที่อยู่ defaultFrom ต้องอยู่บนโดเมนที่เผยแพร่ SPF, DKIM และ DMARC แล้ว สร้างระเบียนด้วย [เครื่องมือสร้าง SPF](https://sendcorex.com/th/tools/spf-generator) และ [เครื่องมือสร้าง DMARC](https://sendcorex.com/th/tools/dmarc-generator)

### ในหน้านี้

ส่งจาก Strapi ในไม่กี่นาที

สร้างบัญชีฟรี ยืนยันโดเมน แล้ววางการตั้งค่าด้านบน

[เริ่มฟรี — 3,000 อีเมล/เดือน](https://app.sendcorex.com/authentication/register?appid=smtp)

ไม่ต้องใช้บัตรเครดิต

## อ่านต่อ

[บทเรียน ### วิธีส่งอีเมลด้วย Node.js (Nodemailer และ REST API) สองวิธีส่งอีเมลจาก Node.js — Nodemailer ผ่าน SMTP หรือการเรียก fetch ธรรมดา พร้อมโค้ดที่ใช้งานได้ การจัดการข้อผิดพลาด และการตั้งค่า DNS อ่านคู่มือ](https://sendcorex.com/th/blog/send-email-nodejs) [บทเรียน ### ส่งอีเมลจาก Next.js (App Router และ Route Handler) Route Handler, Server Action และเทมเพลต React Email พร้อมฟอร์มติดต่อจริง การจัดการข้อผิดพลาด และการตั้งค่า DNS อ่านคู่มือ](https://sendcorex.com/th/blog/send-email-nextjs) [การส่งถึง ### อธิบาย SPF, DKIM และ DMARC ระเบียน DNS สามตัวคั่นระหว่างอีเมลของคุณกับกล่องจดหมาย นี่คือสิ่งที่แต่ละตัวพิสูจน์จริงๆ และสิ่งที่เกิดขึ้นเมื่อขาดตัวใดตัวหนึ่ง อ่านคู่มือ](https://sendcorex.com/th/blog/spf-dkim-dmarc-explained)

ส่งจาก Strapi ในไม่กี่นาที

สร้างบัญชีฟรี ยืนยันโดเมน แล้ววางการตั้งค่าด้านบน

ไม่ต้องใช้บัตรเครดิต

[เริ่มฟรี — 3,000 อีเมล/เดือน](https://app.sendcorex.com/authentication/register?appid=smtp) [ดูราคา](https://sendcorex.com/th/pricing)
