Ask Your Question
1

How to setup email notifcation

asked 2013-12-12 00:07:17 -0500

SocialQA gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-15 12:52:18 -0500

nicanorl gravatar image

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

edit flag offensive delete link more

Comments

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

SocialQA gravatar imageSocialQA ( 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 gravatar imageEvgeny ( 2013-12-22 13:01:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-12-12 00:07:17 -0500

Seen: 315 times

Last updated: Dec 15 '13