flask mail error: headers = [self.sender, self.reply_to] + self.recipients
So here is what solved the problem I was having. (This is about the recipients parameter in Message). I have only one recipient. But I suppose many recipients are expected. In any event, changing my one recipient from a string to a list did the trick.For example going from
recipients=email
to
recipients=email.split()
fixes the problem. I'm new to flask-mail and I didn't think twice about using a string for recipients.
I ran into the same problem today here is how I solved it.
recipient = request.form.get("email")Message(subject=subject, recipients=[recipient]
recipients should be passed as a list even if you have one.
Parameters:
- recipients – list of email addresses