Odoo Email Configuration
🇹🇭 ภาษาไทย
การตั้งค่าอีเมลใน Odoo มี 2 ส่วนหลัก: ส่งออก (Outgoing SMTP) และ รับเข้า (Incoming IMAP) และมี option พิเศษ Custom Email Servers สำหรับใช้ mail server ของตัวเองแทน server ของ Odoo
ขั้นตอนที่ 0 — เปิด Developer Mode
ก่อนตั้งค่าอีเมล ต้องเปิด Developer Mode ก่อน:
Settings → (scroll ลงล่าง) → Activate the developer mode
จากนั้นถึงจะเห็นเมนู Settings → Technical → Email
เปิดใช้งาน Custom Email Servers
Path: Settings → General Settings → Discuss
☑ Use Custom Email Servers
เมื่อเปิดแล้ว Odoo จะ หยุดใช้ mail server ของตัวเอง และใช้ server ที่กำหนดแทนทั้งหมด
⚠️ ใน Odoo Online (SaaS) ถ้าไม่เปิด option นี้ Odoo จะส่งจาก
@mail.odoo.comเสมอ
Outgoing Mail Server (ส่งอีเมลออก)
Path: Settings → Technical → Email → Outgoing Mail Servers → New
| Field | คำอธิบาย |
|---|---|
| Name | ชื่อ server เช่น “Company SMTP” |
| Priority | ตัวเลขน้อย = ใช้ก่อน (default: 10) |
| SMTP Server | hostname ของ mail server |
| SMTP Port | 25 / 465 / 587 |
| Connection Security | None / STARTTLS / SSL/TLS |
| Username | อีเมล หรือ SMTP username |
| Password | password หรือ App Token |
| From Filter | จำกัดว่า server นี้ส่งได้เฉพาะ domain อะไร |
ค่าสำหรับ Provider หลัก
| Provider | SMTP Server | Port | Security |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | STARTTLS |
| Microsoft 365 | smtp.office365.com | 587 | STARTTLS |
| Outlook.com | smtp-mail.outlook.com | 587 | STARTTLS |
| SendGrid | smtp.sendgrid.net | 587 | STARTTLS |
Gmail: ต้องสร้าง App Password → Google Account → Security → 2-Step Verification → App passwords (ต้องเปิด 2FA ก่อน)
Microsoft 365: ต้องเปิด SMTP AUTH → Exchange Admin Center → Users → [user] → Mail → Manage email apps → ✅ Authenticated SMTP
หลังบันทึก → คลิก Test Connection → ✅ = เชื่อมสำเร็จ
From Filter — กรณีมีหลาย SMTP
ถ้ามีหลาย domain หรือ multi-company ใช้ From Filter เพื่อให้ Odoo เลือก server อัตโนมัติ:
Server 1: smtp.company-a.com → From Filter: company-a.com
Server 2: smtp.company-b.com → From Filter: company-b.com
Odoo จับคู่ From address กับ From Filter และเลือก server ที่ถูกต้องให้เอง
Incoming Mail Server (รับอีเมลเข้า)
ใช้สำหรับ: รับ reply เข้า ticket / สร้าง lead จากอีเมล / รับ vendor bill
Path: Settings → Technical → Email → Incoming Mail Servers → New
| Field | ค่า |
|---|---|
| Server Type | IMAP (แนะนำ) หรือ POP3 |
| Server | imap.gmail.com / outlook.office365.com |
| Port | 993 (IMAP+SSL) |
| SSL/TLS | ✅ เปิด |
| Username / Password | อีเมลและ App Password |
| Actions | เลือกว่ารับแล้วจะทำอะไร (สร้าง ticket / lead) |
Fetch interval: ดึงอีเมลทุกกี่นาที (default 5 นาที)
Email Alias — สร้างข้อมูลอัตโนมัติจากอีเมล
แต่ละ module มี alias ของตัวเอง:
| Module | Alias ตัวอย่าง | สร้างอะไร |
|---|---|---|
| Helpdesk | [email protected] | Ticket อัตโนมัติ |
| CRM | [email protected] | Lead อัตโนมัติ |
| Accounting | [email protected] | Vendor Bill |
| Recruitment | [email protected] | Application |
ตั้ง Alias Domain:
Settings → General Settings → Discuss → Alias Domain
→ ใส่ yourdomain.com
DNS ของ domain ต้องมี MX record ชี้มาที่ Odoo server ด้วย
DNS Records — ป้องกัน Email ตก Spam
SPF Record
TXT @ "v=spf1 include:_spf.odoo.com mx ip4:YOUR_SERVER_IP ~all"DKIM Record
Key ได้จาก Settings → Technical → Email → DKIM Keys
TXT odoo._domainkey "v=DKIM1; p=YOUR_PUBLIC_KEY"DMARC Record
TXT _dmarc "v=DMARC1; p=quarantine; rua=mailto:[email protected]"ตั้ง SPF + DKIM ก่อนเสมอ — ถ้าไม่มีอีเมลจาก Odoo จะตก Spam หรือถูก reject
กรณีพิเศษ: Odoo.sh — Mail Catcher
ใน Odoo.sh สาขา Staging / Development จะมี Mail Catcher ดักอีเมลไว้ — ไม่ส่งออกจริง:
Staging / Development branch
→ อีเมลทั้งหมด intercept ใน Mail Catcher
→ ดูได้ที่ Odoo.sh Dashboard → Mails tab
Production branch เท่านั้น → ส่งออกจริง
Troubleshooting
| อาการ | สาเหตุที่พบบ่อย |
|---|---|
| อีเมลตก Spam | SPF / DKIM ยังไม่ได้ตั้ง DNS |
| ส่งไม่ออก | SMTP port ถูก block โดย firewall / ISP |
| Authentication failed | Gmail → ต้องใช้ App Password ไม่ใช่ password ปกติ |
| Microsoft 365 ส่งไม่ได้ | SMTP AUTH ยังไม่ได้เปิดใน Exchange Admin |
| อีเมลค้างใน queue | Scheduled Action “Email Queue Manager” ไม่ทำงาน |
ดู Email Queue:
Settings → Technical → Email → Emails
→ ดู status: Sent / In Queue / Exception
Related
- Odoo — หน้าหลัก ERP
- Odoo Deployment — Odoo.sh Mail Catcher, hosting options
- Odoo Helpdesk — รับ ticket ผ่าน email alias
- Odoo CRM — สร้าง lead จาก incoming email
- n8n — Workflow automation ที่ trigger จาก email ได้
🇬🇧 English
Odoo email configuration has two main parts: Outgoing SMTP and Incoming IMAP, plus the Custom Email Servers option to bypass Odoo’s default mail infrastructure.
Enable Custom Email Servers
Path: Settings → General Settings → Discuss
☑ Use Custom Email Servers
Once enabled, Odoo stops using its own mail servers and uses only the servers you define.
⚠️ On Odoo Online (SaaS), without this option enabled, all emails are sent from
@mail.odoo.com
Outgoing Mail Server
Path: Settings → Technical → Email → Outgoing Mail Servers → New
| Field | Description |
|---|---|
| Name | Server label e.g. “Company SMTP” |
| Priority | Lower number = used first (default: 10) |
| SMTP Server | Hostname of your mail server |
| SMTP Port | 25 / 465 / 587 |
| Connection Security | None / STARTTLS / SSL/TLS |
| Username | Email address or SMTP username |
| Password | Password or App Token |
| From Filter | Restrict this server to a specific domain |
Common Providers
| Provider | SMTP Server | Port | Security |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | STARTTLS |
| Microsoft 365 | smtp.office365.com | 587 | STARTTLS |
| Outlook.com | smtp-mail.outlook.com | 587 | STARTTLS |
| SendGrid | smtp.sendgrid.net | 587 | STARTTLS |
Gmail: Generate an App Password at Google Account → Security → 2-Step Verification → App passwords (requires 2FA enabled)
Microsoft 365: Enable SMTP AUTH at Exchange Admin Center → Users → [user] → Mail → Manage email apps → ✅ Authenticated SMTP
After saving → click Test Connection → ✅ = success
From Filter — Multiple SMTP Servers
For multi-domain or multi-company setups, use From Filter so Odoo auto-selects the correct server:
Server 1: smtp.company-a.com → From Filter: company-a.com
Server 2: smtp.company-b.com → From Filter: company-b.com
Incoming Mail Server
Path: Settings → Technical → Email → Incoming Mail Servers → New
| Field | Value |
|---|---|
| Server Type | IMAP (recommended) or POP3 |
| Server | imap.gmail.com / outlook.office365.com |
| Port | 993 (IMAP+SSL) |
| SSL/TLS | ✅ Enabled |
| Username / Password | Email address and App Password |
| Actions | Define what to create on receipt (ticket / lead) |
Email Aliases
| Module | Example Alias | Creates |
|---|---|---|
| Helpdesk | [email protected] | Ticket automatically |
| CRM | [email protected] | Lead automatically |
| Accounting | [email protected] | Vendor Bill |
| Recruitment | [email protected] | Application |
Set the Alias Domain at Settings → General Settings → Discuss → Alias Domain
Required DNS Records
# SPF
TXT @ "v=spf1 include:_spf.odoo.com mx ip4:YOUR_IP ~all"
# DKIM (key from Settings → Technical → Email → DKIM Keys)
TXT odoo._domainkey "v=DKIM1; p=YOUR_PUBLIC_KEY"
# DMARC
TXT _dmarc "v=DMARC1; p=quarantine; rua=mailto:[email protected]"Odoo.sh: Mail Catcher
Staging and Development branches on Odoo.sh intercept all outgoing emails in a Mail Catcher — emails never leave the platform. Only the Production branch sends real emails.
Troubleshooting
| Symptom | Common Cause |
|---|---|
| Emails landing in spam | SPF / DKIM DNS records not set |
| Cannot send | SMTP port blocked by firewall or ISP |
| Authentication failed | Gmail: must use App Password, not login password |
| Microsoft 365 blocked | SMTP AUTH not enabled in Exchange Admin |
| Emails stuck in queue | ”Email Queue Manager” scheduled action not running |
Check queue: Settings → Technical → Email → Emails → filter by status
Related
- Odoo — Main Odoo ERP page
- Odoo Deployment — Odoo.sh Mail Catcher, hosting options
- Odoo Helpdesk — Email-to-ticket via alias
- Odoo CRM — Email-to-lead via alias
- n8n — Workflow automation triggered from email