Custom Search

Friday, November 22, 2013

Python Django How to send email from python console

0)
First setup and configure email server (exim)

1)
Activate virtualenv

2)
Got you django project folder and run following command
#export DJANGO_SETTINGS_MODULE=myproject.settings



3)
Open python terminal and run following command
#python
import myproject.settings as setting


setting.EMAIL_HOST
setting.EMAIL_PORT
 

from django.core.mail import send_mail
 

send_mail('Subject here2', 'Here is the message1.', 'from@mymailserver.com', ['sajuptpm@gmail.com'], fail_silently=False)

1 comment:

  1. Missing :Mx, DKIM, SPF Records.
    It's incomplete video
    Hostname configuration.How is communicating DNS to server.
    Please make it complete video on this topic. So we can utilize

    ReplyDelete