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.

SocialQA's avatar
265
SocialQA
asked 2013-12-12 00:07:17 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment 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

nicanorl's avatar
55
nicanorl
answered 2013-12-15 12:52:18 -0500
edit flag offensive 0 remove flag delete link

Comments

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

SocialQA's avatar SocialQA (2013-12-21 10:09:50 -0500) edit

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 (2013-12-22 13:01:44 -0500) edit
add a comment see more comments