I set up the sendmail email backend with this snippet
I open the shell and run (with actual email accounts):
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com',
['to@example.com'], fail_silently=False)
After that, the console just prints a:
1
No error messages or anything… but the emails never arrive on the other end…
Is there anything else that I need to configure?
Thanks,
Requested the mail server’s error logs from my hosting provider and saw this:
send_to_gateway router failed to expand "${perl{mailtrapheaders2}}":
Undefined subroutine &main::mailtrapheaders2 called.\n`
They are still trying to figure it out :S
In the snippet code:
which returns a variable
num_sentwhich is incremented for every mail that has been actually sent. This is the1your are seeing displayed in the console.