---
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/vi/blog/strapi-email-smtp

Bài thực hành

# Cấu hình email Strapi với SMTP (provider Nodemailer)

Cài provider Nodemailer, thêm một khối cấu hình và thử từ trang admin.

Bởi đội ngũ Sendcorex·Cập nhật 18 thg 11, 2026·5 phút đọc

## 1. Cài provider

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

## 2. Cấu hình 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. Thử từ trang admin

Khởi động lại Strapi, mở **Settings → Email → Configuration** và gửi email thử. Email của Users & Permissions (xác nhận, đặt lại mật khẩu) giờ cũng đi qua SMTP relay của bạn.

## 4. Gửi từ code của bạn

```
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. Xác thực tên miền

Địa chỉ defaultFrom phải nằm trên tên miền đã công bố SPF, DKIM và DMARC. Tạo bản ghi bằng [trình tạo SPF](https://sendcorex.com/vi/tools/spf-generator) và [trình tạo DMARC](https://sendcorex.com/vi/tools/dmarc-generator) .

### Trên trang này

Gửi từ Strapi trong vài phút

Tạo tài khoản miễn phí, xác minh tên miền và dán cấu hình ở trên.

[Bắt đầu miễn phí — 3.000 email/tháng](https://app.sendcorex.com/authentication/register?appid=smtp)

Không cần thẻ tín dụng

## Đọc tiếp

[Bài thực hành ### Cách gửi email bằng Node.js (Nodemailer và REST API) Hai cách gửi email từ Node.js — Nodemailer qua SMTP hoặc một lệnh fetch đơn giản — kèm code chạy được, xử lý lỗi và cấu hình DNS. Đọc hướng dẫn](https://sendcorex.com/vi/blog/send-email-nodejs) [Bài thực hành ### Gửi email từ Next.js (App Router và Route Handler) Route Handler, Server Action và template React Email — kèm form liên hệ thật, xử lý lỗi và cấu hình DNS. Đọc hướng dẫn](https://sendcorex.com/vi/blog/send-email-nextjs) [Khả năng vào hộp thư ### Giải thích SPF, DKIM và DMARC Ba bản ghi DNS đứng giữa email của bạn và hộp thư. Đây là những gì mỗi bản ghi thực sự chứng minh, và điều gì xảy ra khi thiếu một cái. Đọc hướng dẫn](https://sendcorex.com/vi/blog/spf-dkim-dmarc-explained)

Gửi từ Strapi trong vài phút

Tạo tài khoản miễn phí, xác minh tên miền và dán cấu hình ở trên.

Không cần thẻ tín dụng

[Bắt đầu miễn phí — 3.000 email/tháng](https://app.sendcorex.com/authentication/register?appid=smtp) [Xem bảng giá](https://sendcorex.com/vi/pricing)
