[Answer]-Error When Using Django send_mail() Function

1👍

Think about what Invite.objects.values('email_address') returns? Definitely not what the send_mail function accepts (a list of email addresses).

Invite.objects.values_list('email_address', flat=True) is what you need. Oh, and remove the [].

send_mail('foo', 'bar', 'baz@example.com', Invite.objects.values_list(...))

Leave a comment