Oke I will post all my code here, can you check it for me, please.
You can get this content to test just like my code ( sending by Gmail to this mail in your code )
import imaplib import base64 import chardet import quopri from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart mail_st = "[email protected]" pass_st = "password" imap = imaplib.IMAP4_SSL("mail.eplatform.vn",993) imap.login(mail_st,pass_st) #quét mail imap.select("INBOX") status, response = imap.search(None,'(UNSEEN)') unread_msg_nums = response[0].split() #in tổng mail chưa đọc print(len(unread_msg_nums)) #bắt đầu đọc mail for e_id in unread_msg_nums: _, response = imap.fetch(e_id, '(RFC822)') print('bắt đầu in mail') content_email = str(response[0][1]) print (content_email) str1 = 'Content-Transfer-Encoding: base64' str2 = 'Content-Transfer-Encoding: quoted-printable' str3 = 'Content-Transfer-Encoding: 8bit' #chia câu lệnh if để chạy mail if str1 in content_email: print('test thử coi sao') aaa= '5paw44GX44GE54mp5Lu244GM55m76Yyy44GV44KM44G+44GX44Gf44Gu44Gn44CB44GU56K66KqN\r\n44GP44Gg44GV44GE44CCCQ0KCQ0K5Y+X5LuY5pel77yaMjAxOOW5tDA55pyIMjDml6UJDQrlvpfm\r\nhI/lhYjlkI3vvJrjg4/jgqbjgrnjg4bjgq/jg47moKrlvI/kvJrnpL4gLQkNCuaLheW9k+iAhe+8\r\nmiBpbWFuaXNoaQkNCueoruWIpTog5qeL6YCgQ0FE5YWl5YqbCQ0K54mp5Lu2IDEg5Lu2CQ0KDQoJ\r\n54mp5Lu244Kz44O844OJ77yaMTAwMDAwNTANCgnnianku7blkI3vvJrlpKfkuYXkv53kuK0xMeWP\r\ntw0KCeeZuuazqOWFg++8mumWouilv+ODm+ODvOODoA0KCeeZuuazqOWGheWuue+8muioguatow0K\r\nCeW4jOacm+e0jeacn++8mjIwMTgtMDktMjEgQU0NCg0K6YCj57Wh5qyE77yaDQo=' data1 = base64.b64decode(aaa) print(data1) begin_encoding = content_email.find('Content-Transfer-Encoding: base64') + 41 retun_begin = content_email[begin_encoding:-1] end_encoding = (retun_begin.find('Content-Type')) - 38 retun_end = retun_begin[0:end_encoding] print('bắt đầu base64') print (type(retun_end)) print(retun_end) if retun_end: data = base64.b64decode(retun_end) print(data)You can change email and pw of your, and send some mail in japanese language to this mail. I suggest sending mail by Gmail, remember that my problem is about decode to Japanese language
You can get this content to test just like my code ( sending by Gmail to this mail in your code )
新しい物件が登録されましたので、ご確認ください。 受付日:2018年09月20日 得意先名:ハウステクノ株式会社 - 担当者: imanishi 種別: 構造CAD入力 物件 1 件 物件コード:10000050 物件名:大久保中11号 発注元:関西ホーム 発注内容:訂正 希望納期:2018-09-21 AM 連絡欄: