ASP classic CDO email uses UTF-8 in text

How can I send email using UTF-8 encoding. Please note that I need to use it in the text, not in the htmlbody.

Everything works fine if I use it in htmlbody, but when I tried to use textbody. I got the aschii code character

objCDOMailer.TextBody = "test - Rozwiązanie" >> having a problem objCDOMailer.HTMLBody = "test - Rozwiązanie" >> dont have a problem 

I used the code below for both of the above.

  objMail.BodyPartCharset = "UTF-8" 
+4
source share
2 answers

use

 bjCDOMailer.TextBodyPart.Charset = "utf-8" 

for charcter encoding.

 objCDOMailer.BodyPart.Charset = "utf-8" objCDOMailer.HTMLBodyPart.Charset = "utf-8" 

Above do not work.

+5
source

Try setting encoding separately for TextBody and HTMLBody

 objCDOMailer.BodyPart.Charset = "utf-8" bjCDOMailer.TextBodyPart.Charset = "utf-8" objCDOMailer.HTMLBodyPart.Charset = "utf-8" 
0
source

Source: https://habr.com/ru/post/1393721/


All Articles