There’re 2 ways to do it, the first is sending the email out to an existing email address, the second is don’t actually send it, just print email out in your command line, which is very convenient for developers, so you don’t need to actually check your email.
The first way send to existing email address, let’s take 163.com mailbox for example:
Add following to your settings.py or local_settings.py
EMAIL_HOST = “smtp.163.com”
EMAIL_PORT = “25”
EMAIL_HOST_USER = “yourmailname@163.com”
EMAIL_HOST_PASSWORD = “yourpassword”
EMAIL_USE_TLS = False
DEFAULT_FROM_EMAIL = “yourmailname@163.com”
Now register an account on your pinax site, please input a invalid email address when you fill up the join up form. Then login as admin, go to url: http://localhost:8000/admin/mailer/me ...
you should be able see the confirm email message, maybe other email messages to be sent. Btw when you send an email in pinax, it will be listed here too.
If you want to actually send the email out, please enter your pinax environment, type:
python manage.py send_mail
If you use windows, probably you will see an error which says “NameError : global name ‘thread’ is not defined”. To solve this, you need go to yourpathto/pinax/Lib/site-packages/mailer/lockfile.py, add ‘import thread’ on line 59, now try type:
python manage.py send_mail, it should work for you now.
To send the emails have been deferred, you should type:
python manage.py retry_deferred
To make the notification actually out, you should type:
python manage.py emit_notices
If you windows you’ll probably will see error “NameError: global name ‘thread’ is not defined” again, now you need to go to yourpathto/pinax/Lib/site-packages/notification/lockfile.py, add ‘import thread’ on line59, it will work for you.
The second way is printing the email out in command line.
1. type this in your command line:
python -m smtpd -n -c DebuggingServer localhost:1025[[BR]]
Please keep the window open.
2. add the following in settings.py or local_settings.py
EMAIL_HOST = “localhost”
EMAIL_PORT = “1025”
3. send an email in pinax, you can do it by sign up new account, or any other way to do.
4. type this to actually send the email:
python manage.py send_mail
5. you’ll see the email message in your command line window of python -m smtpd -n -c DebuggingServer localhost:1025