email sender django project code example
Example 1: 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.','[email protected]',
[created_object.email], fail_silently=False,)
Example 2: Undefined variable: 'EmailMessage' IN DJANGO
python -m smtpd -n -c DebuggingServer localhost:1025