1
Setting.py-

EMAIL_BACKEND = "mailer.backend.DbBackend"
EMAIL_SUBJECT_PREFIX = "[.....]"

EMAIL_HOST          = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'tester@@abcd'
EMAIL_HOST_USER     = 'tester.abcd@gmail.com'
EMAIL_PORT          = 587
EMAIL_USE_TLS       = True

DEFAULT_FROM_EMAIL  = 'tester.abcd@gmail.com'
DEFAULT_ADMIN_EMAIL  = 'tester.abcd@gmail.com'
TEMPORARY_CC_EMAIL = 'tester.abcd@gmail.com'
CONTACTUS_EMAIL = 'tester.abcd@gmail.com'
JOBAPPLY_EMAIL = 'tester.abcd@gmail.com'

urls.py:

urlpatterns = patterns('django.contrib.auth.views',
 url(r'^password-reset/$', 'password_reset', {
      'template_name': 'profiles/password_reset_form.html',
    'password_reset_form': PassResetForm
  }, name='password-reset'),
 url(r'^password-reset-process/$', 'password_reset_done', {
    'template_name': 'profiles/password_reset_done.html',
  }, name='password-reset-done'),
 url(r'^password-reset-confirm/(?P<uidb36>[0-9a-zA-Z]{1,13})-(?P<token>.+)/$',
    'password_reset_confirm',
    {'template_name': 'profiles/password_reset_confirm.html',},
    name='password-reset-confirm'),
 url(r'^password-reset-complete', 'password_reset_complete', {
    'template_name': 'profiles/password_reset_complete.html',
  }, name='password-reset-complete'),

This is my code wheni enter my mail and click submit it correctly redirects to the next page but mail is not send,is there anything pblm with this code

Benjamin Toueg
  • 10,511
  • 7
  • 48
  • 79

1 Answers1

0

You should start by testing if the problem comes from your code or the email backend.

Here is how to setup the Django console email backend:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

This should output emails in the console when you are running the server on your local dev machine python manage.py runserver.

If the emails are printed correctly into the console, then there is something wrong with your configuration either here:

EMAIL_HOST          = 'smtp.gmail.com'
EMAIL_HOST_PASSWORD = 'tester@@abcd'
EMAIL_HOST_USER     = 'tester.abcd@gmail.com'
EMAIL_PORT          = 587
EMAIL_USE_TLS       = True

or here:

EMAIL_BACKEND = "mailer.backend.DbBackend"
Benjamin Toueg
  • 10,511
  • 7
  • 48
  • 79