Reputation: 3080
How can i get django send_mail result of email send. I run it local, i do send_mail to my email, and it return True, but letter not sended (because i have not any smtp set). But result is True. How to get real result?
Upvotes: 3
Views: 4993
Reputation: 3115
I would also suggest to use exceptions to find out whether email was sent or not. If you haven't time or option to set up an email server I would suggest to use django+gmail. U can create a 'fake' gmail account (create another one if you already own gmail-acc, it could be 'baned') and use its SMTP as a opportunity to send emails, even if you're working with django's development server (localy). How to is here
Upvotes: 1
Reputation: 6981
Use django-mailer. It puts the emails in the database and uses a cron-jobbed management command to send it out. It will help you track this issue down, improve your app response time, and also make your life easier.
Upvotes: 4
Reputation: 14836
Django uses exceptions to handle email sending problems. The value returned by send_mail
is the number of emails that were sent.
If you're not getting an exception, it could be one of a number of things:
fail_silently
set to True (default is False)Upvotes: 5