Sending Email : Django Terminal Test.

on July 31, 2013

While I was making contact-us form in PHP for my client then I thought about to do same in Djago-Python. Target was to get the form input and email it. Here I'm going to test only the DjangoEmail module using shell.
Edit with code below:
    #settings for django email( writing for gmail)
    EMAIL_USE_TLS = True
    EMAIL_HOST = ''
    SITE_HOST = ''
    DEFAULT_FROM_EMAIL ='Dotorbit Team '
    EMAIL_PORT = 587
    EMAIL_HOST_PASSWORD = 'your-password'
    #Run interactive mode, 
    python shell
    #Import the EmailMessage module,
    >>>from django.core.mail import EmailMessage
    #Send the email,
    >>>email = EmailMessage('Subject goes here ', ' Body goes here ', to=[''])

This will return 1, means everything is working fine. form and view, I'll write in next post.


David Jackson said...

Hello this is nice blog thank you for sharing this blog there are more content about test only glendora I appreciate good job thank you
test only glendora

Post a Comment