Reputation: 575
I first tried to use django send_mail function in my python code.
But my live servers does not support SMTP and hence i was asked to try using qmail-inject or mail which are unix commands.
Has anyone does this before ? how can we set the subject, recipient etc from python code and send a email using qmail-inject or mail which are unix commands?
Upvotes: 1
Views: 281
Reputation: 174662
You need to create a custom email backend that does the sending for you. You can customize this snippet, which uses sendmail
and replace that with the appropriate command for your scenario.
Once you have your custom backend, set EMAIL_BACKEND
in settings.py
to point to the Python module path not the filesystem path.
Upvotes: 1