> For the complete documentation index, see [llms.txt](https://tailieu.smax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.smax.ai/module-cai-dat/tich-hop/smtp.md).

# SMTP

{% hint style="info" %}
Hướng dẫn kết nối SMTP Google để gửi email tự động
{% endhint %}

## 1\_ Tạo mật khẩu SMTP

Bước 1: Truy cập vào phần quản lý tài khoản Google và chọn tìm kiếm <mark style="color:orange;">**Mật khẩu ứng dụng**</mark>

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2F1VpkoOnVfLwCJkBVFOOE%2Fimage.png?alt=media&amp;token=d06521fb-faff-4249-8c29-e5dcf0772484" alt=""><figcaption></figcaption></figure>

Bước 2: Đặt tên cho ứng dụng và chọn <mark style="color:orange;">**Tạo**</mark>

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FeN6yIxuR17APktIyN9Fm%2Fimage.png?alt=media&amp;token=20775351-e98f-4e33-9da4-a35809b9a424" alt=""><figcaption></figcaption></figure>

Sau khi tạo xong, Google sẽ trả về cho bạn một dãy mật khẩu để kết nối SMTP

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FTjMTVvc8TWO94C3bvziD%2Fimage.png?alt=media&amp;token=646833c6-0865-4ed6-9dc2-243e2b616137" alt=""><figcaption></figcaption></figure>

## 2\_ Kết nối SMTP

Bước 1: Chọn nền tảng <mark style="color:orange;">**SMTP**</mark>

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FwVXvutRKcuBfSZ34XBgR%2Fimage.png?alt=media&amp;token=0446725f-8f01-4946-8e3f-3d7a238fa21e" alt=""><figcaption></figcaption></figure>

Bước 2: Nhập các thông tin vào cửa sổ kết nối

<mark style="color:orange;">**(1)**</mark> - Tên: Tên kết nối SMTP

<mark style="color:orange;">**(2)**</mark> - Mô tả: Mô tả kết nối SMTP

<mark style="color:orange;">**(3)**</mark> - From Email: Địa chỉ email gửi đi

<mark style="color:orange;">**(4)**</mark> - From Name: Tên người gửi đi

<mark style="color:orange;">**(5)**</mark> - Reply To Email: Email nhận tin

<mark style="color:orange;">**(6)**</mark> - SMTP Host: <mark style="color:purple;">**smtp.gmail.com**</mark>

<mark style="color:orange;">**(7)**</mark> - SMTP Port: <mark style="color:purple;">**465**</mark> / Encrypt: <mark style="color:purple;">**NONE**</mark>

<mark style="color:orange;">**(8)**</mark> - SMTP Username: Địa chỉ email của người gửi

<mark style="color:orange;">**(9)**</mark> - SMTP Password: Mật khẩu ứng dụng tạo ở bước 1

<mark style="color:orange;">**(10)**</mark> - Test Email: Địa chỉ email nhận tin test, bạn có thể nhập email bất kỳ và nhấn Send, sau đó vào phần hộp thư để kiểm tra tin đã được gửi hay chưa

Sau đó chọn <mark style="color:orange;">**Lưu**</mark> để tạo kết nối SMTP

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2F9kCnO8UwMnhU46ftPzpG%2Fimage.png?alt=media&amp;token=3e16f9cc-0528-4f42-a9ee-840209ef8d3c" alt=""><figcaption></figcaption></figure>
