Problem with HTML code when sending email using Acbrmail

Asked

Viewed 175 times

0

I am using Acbrmail to send a standard Html that is hosted on the Web. I take the Html source code from the Utf8tostring(idHTTP.Get()) and replace the tags needed to send with Stringreplace().

HtmlPadrao := UTF8ToString(FIdHTTP.Get('http://remy.corework.com.br/mail/mail01.html'));
HtmlPadrao := StringReplace(HtmlPadrao, 'images/', 'http://remy.corework.com.br/mail/images/', [rfReplaceAll]);
HtmlPadrao := StringReplace(HtmlPadrao, '<nome da="" pessoa="">', '&nbsp;'+NomeCliente, [rfReplaceAll]);
HtmlPadrao := StringReplace(HtmlPadrao, '&lt;N??MERO DA COMPRA&gt;', NumeroCompra, [rfReplaceAll]);

However, I’m having problems with U (capital U with accent), it looks like this in the email sent:

N.? MERE OF THE PURCHASE

D?? LIVES?!

I tried to replace the word "N?? MERO" but it didn’t work. I made a Savetofile to check and in the text, it’s like N??. But I can’t replace to show the correct Html.

I need to replace the html code '<N?? MERO DA COMPRA>' with the purchase number (Ex.: 42)

How to solve it? And why does it happen?

1 answer

0

It is necessary to replace the String the way the site returns, try this Stringreplace:

HtmlPadrao := StringReplace(HtmlPadrao, '&lt;N&uacute;mero da Compra&gt;', NumeroCompra, [rfReplaceAll]);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.