All following configuration parameters are set in configuration.py
EMAIL = {
'SERVER': 'mail.example.com',
'PORT': 25,
'USE_TLS': False,
'TIMEOUT': 2,
'FROM_EMAIL': 'peering-manager@example.com',
}
EMAIL = {
'SERVER': 'mail.example.com',
'PORT': 465,
'USERNAME': 'peering-manager@example.com',
'PASSWORD': '****************',
'USE_TLS': True,
'TIMEOUT': 2,
'FROM_EMAIL': 'peering-manager@example.com',
}
Enter the management shell
cd /opt/peering-manager
source venv/bin/activate
./manage.py shell
Import the send_mail
function
from django.core.mail import send_mail
Use send_mail
to send a test message. Reference the send_mail documentation for more detail.
send_mail('Subject','Body test 1','peering-manager@example.com',['recipient@example.com'],fail_silently=False)