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',
'from@email.com',
[user.email for user in User.objects.all()]
)
On Tue, Mar 29, 2016 at 12:42 PM, Abhinav Gupta <abhinav96gupta1@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+unsubscribe@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.
For more options, visit https://groups.google.com/d/optout.
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+unsubscribe@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.
No comments:
Post a Comment