Thursday, May 20, 2021

How to Send Email using Django

How to Configure Django Local Mail Server 

Hey guys let's start to few lines of code can send email
send_mail import this package top of the code section.
from django.core.mail import send_mail
The below code to paste where you want
send_mail(
    'Your subject',
    'Your message body',
    'from@mail.com',
    ['to@mail.com'],
    fail_silently=False,
)
Settings.py
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Thank you.Happy coding!

Previous Post
Next Post

0 Comments: