Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
google应用程序引擎python邮件api更改为其他语言的utf-8?_Python_Google App Engine - Fatal编程技术网

google应用程序引擎python邮件api更改为其他语言的utf-8?

google应用程序引擎python邮件api更改为其他语言的utf-8?,python,google-app-engine,Python,Google App Engine,好吧,这是我到目前为止得到的,但它不起作用。如何将utf-8编码为mail api,并使其在一封电子邮件中使用多种语言 提前感谢。.encode('utf-8')将字符串转换成二进制。您必须使用.decode('utf-8') 请参阅:.encode('utf-8')将字符串转换为二进制。您必须使用.decode('utf-8') 请看:我也想出了办法 我发现的一种方法是通过html发送邮件 body = """ Welcome %s, Congratulations, you have jus

好吧,这是我到目前为止得到的,但它不起作用。如何将utf-8编码为mail api,并使其在一封电子邮件中使用多种语言

提前感谢。

.encode('utf-8')
将字符串转换成二进制。您必须使用
.decode('utf-8')
请参阅:

.encode('utf-8')
将字符串转换为二进制。您必须使用
.decode('utf-8')

请看:我也想出了办法

我发现的一种方法是通过html发送邮件

body = """
Welcome %s,
Congratulations, you have just joined us.

Start using our site by click the link below:
%s

We hope that you enjoy!

Team.

恭喜妳/你已成為會員。

%s

希望妳能享受使用!

""".encode('utf-8') % (username, request_url, request_url)


mail.send_mail(sender=sender_address, to=email_address, subject=subject, body=body)
ActivationEmailMessage.html=u”“”
xxxxxx
.encode('ascii','xmlcharrefreplace')
ActivationEmailMessage.send()

我知道怎么做了

我发现的一种方法是通过html发送邮件

body = """
Welcome %s,
Congratulations, you have just joined us.

Start using our site by click the link below:
%s

We hope that you enjoy!

Team.

恭喜妳/你已成為會員。

%s

希望妳能享受使用!

""".encode('utf-8') % (username, request_url, request_url)


mail.send_mail(sender=sender_address, to=email_address, subject=subject, body=body)
ActivationEmailMessage.html=u”“”
xxxxxx
.encode('ascii','xmlcharrefreplace')
ActivationEmailMessage.send()
你认为“行不通”应该告诉我们什么?你认为“行不通”应该告诉我们什么?