email = self.request.get(\'email\')
name = self.request.get(\'name\')
mail.send_mail(sender=\"myemail\", email=email, body=name, subject=\"sss \" + name + \"sdafsaã\
You should use:
email = self.request.get('email')
name = self.request.get('name')
mail.send_mail(sender="myemail",
email=email,
body=name,
subject="hello " + name.encode('utf-8') + " user!")
The variable name
is a unicode string and should encoded in utf-8
or in the kind of encode you are using in you web application before concatenating to other byte strings.
Without name.encode()
, Python uses the default 7 bits ascii
codec that can't encode that specific character.