Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sending email with django

from django.core.mail import send_mail
class UserList(generics.ListCreateAPIView):
    queryset = User.objects.all()
    serializer_class = UserSerializer
    def perform_create(self, serializer):
        created_object = serializer.save()
        send_mail('Subject here','Here is the message.','from@example.com', 
            [created_object.email],  fail_silently=False,)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sending #email #django
ADD COMMENT
Topic
Name
8+6 =