If you are using django and your settings has a mail configuration

https://docs.djangoproject.com/en/1.9/topics/email/#smtp-backend

from django.contrib.auth.models import User
send_mail(
    'subject',
    'message',
    'f...@email.com',
    [user.email for user in User.objects.all()]
)


On Tue, Mar 29, 2016 at 12:42 PM, Abhinav Gupta <abhinav96gup...@gmail.com>
wrote:

> I am new to python and i want to send email to all users present in my
> database using python.
> Please HELP!!!!!!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dc2641e8-c7a5-465e-acea-21519850391a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/dc2641e8-c7a5-465e-acea-21519850391a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Ezequiel Bertti
E-Mail: eber...@gmail.com
Cel: (21) 99188-4860

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACrQMYomZETbe%3DjENZgaw88warF5HD62kH2U%3DfELa_9xPbteSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to