영어 (중국어, 일본어 등)로 메일을 보내야합니다. subject.py와 body를 얻을 수있는 template.py 파일이 있습니다. template.py영어 이외의 언어로 메일 보내기
#!/us/bin/python
# -*- coding: utf-8 -*-
subject = '附录E: 配置参考'
body = '附录E: 配置参考'
body와 subject를 template.py 파일에서 읽었습니다.
msg = EmailMultiAlternatives(subject, body, from, to)
msg.attach_alternative(html_content, "text/html")
msg.send()
영어는 지원하지만 다른 언어는 사용할 수 없습니다. 어떻게 해결할 수 있습니까? 페이지 설정
가 어떻게'html_content'을 생성하는 시도? –
오류 메시지가 있습니까? 유니 코드 문자열에서''.encode ("utf-8")''을 실행하는 것만 큼 쉽지 않은 헤더 값의 코딩이 누락되는 문제를 보았습니다. –
http://stackoverflow.com/questions/15885062/unicodeencodeerror-with-attach-file-on-emailmessage-django-error?noredirect=1#comment22664718_15885062 – catherine