Django already ships with send_mail() — configure SMTP once in settings.py and you can send email with a single call. Use it for welcome emails after registration, order confirmations, password resets, or system notifications. No extra library to install, and no hand-rolled SMTP code with smtplib .
The Problem
Many new projects call send_mail() right away without configuring anything, assuming Django “just knows” where to send mail. In reality Django defaults to an SMTP backend pointing at localhost:25 — most dev machines have no mail server, so the request hangs and then fails with ConnectionRefusedError , and users who just registered wait forever for a welcome email that never arrives. Another common mistake is hardcoding the email password straight into settings.py and accidentally committing it to Git — the mailbox gets exposed and abused to send spam.
from django.core.mail import send_mail
send_mail ( " Chao mung ban den voi MyShop " , " Cam on ban da dang ky tai khoan.…