First time here? Check out the FAQ!
1

How to setup email notifcation
 

I am trying to figure out how to setup email notification. I see settings file has following

#outgoing mail server settings
SERVER_EMAIL = ''
DEFAULT_FROM_EMAIL = ''
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_SUBJECT_PREFIX = ''
EMAIL_HOST=''
EMAIL_PORT=''
EMAIL_USE_TLS=False
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

lets say I want to use a gmail account to handle email notification that get send out from my system (Just like how askbot does) How should I set this up.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
SocialQA's avatar
265
SocialQA
asked 11 years ago

Comments

see more comments

1 Answer

1

Try using this settings:

SERVER_EMAIL = 'youremail@gmail.com'
DEFAULT_FROM_EMAIL = 'youremail@gmail.com'
EMAIL_HOST_USER = 'youremail@gmail.com'
EMAIL_HOST_PASSWORD = 'yourpassword'
EMAIL_SUBJECT_PREFIX = ''
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT='587' #try also 645
EMAIL_USE_TLS=True
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

After that, restart apache.

I must say that it didn't worked for me, because Gmail sees the login from my server as suspicious and blocks it.

To test, go to /settings/EMAIL/ and put your email address. Then go to the feedback form and send a test message, if you receive the email, it's working, if not, check the logs in /var/log/apache2/error.log

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
nicanorl's avatar
55
nicanorl
answered 11 years ago
link

Comments

It didn't work for me either, I think I might have to dig into logs.

SocialQA's avatar SocialQA (11 years ago)

Right, all those parameters just need to match the settings of your mail server, which can be running on a localhost, may or may not have TLS and a password or even a user set up to log in.

Evgeny's avatar Evgeny (11 years ago)
see more comments