Email message HTML trouble Encoding text

Hi,
I do not understand well what mean mail.bodyHTML:
Do I must put an HTML code or Xojo provide to format the HTML text?
And how the encoding text to work?

Because I try to send email with the email example
introducing an HTML page and work correctly but the encoding of text do not match
and , , etc. do not match and become not correct!

Thank for help!

Example code of e-mail send message

[code] Dim mail As emailMessage
Dim file As emailAttachment
Dim i As Integer
Dim s As String

// set up the socket
MailSocket.Address = ServerField.Text
MailSocket.Port = 25

If authenticateBox.Value = True Then
MailSocket.Username = UserNameField.Text
MailSocket.Password = PasswordField.Text
Else
MailSocket.Username = “”
End If

// populate the email message
mail = New emailMessage
mail.FromAddress = fromAddressFld.text
mail.Subject = subjectFld.text
mail.BodyPlainText = BodyField.text
mail.BodyHTML = htmlFld.text
mail.Headers.AppendHeader(“X-Mailer”,“Xojo SMTP Demo”)

// add recipients
s = ReplaceAll(ToAddressFld.Text, “,”, Chr(13))
s = ReplaceAll(s, Chr(13)+Chr(10), Chr(13))
For i = 1 To CountFields(s, Chr(13))
mail.AddRecipient(Trim(NthField(s, Chr(13), i)))
Next

// add cc recipients
s = ReplaceAll(ccAddressFld.Text, “,”, Chr(13))
s = ReplaceAll(s, Chr(13)+Chr(10), Chr(13))
For i = 1 To CountFields(s, Chr(13))
mail.AddCCRecipient(Trim(NthField(s, Chr(13), i)))
Next

// add attachments
If fileFld.Text <> “” Then
file = New emailAttachment
file.LoadFromFile(GetFolderItem(fileFld.Text))
mail.Attachments.Append(file)
End If

// send the email
MailSocket.Messages.Append(mail)
MailProgress.Visible = True
MailSocket.SendMail[/code]

How does your html look like? Do you set the header correctly to utf8? Like or similar?

Yes, when I send a HTML page I set this, but
opening email with thunderbird do not read correct the extra ASCII

[quote=227188:@Marco Cagnasso]Yes, when I send a HTML page I set this, but
opening email with thunderbird do not read correct the extra ASCII[/quote]

Any chance you could post a sample HTML page ?

Here is the web page;

[code]

Testodeltitolo

Buongiorno,

siamo lieti di inviarvi il collegamento al nostro catalogo

 

LINK - c a t a l o g o - LINK

 


Per accedere al men del catalogo cliccate sul LINK sopra (quello blu sottolineato).

Se non accade nulla provate a cliccare col bottone destro del mouse dovrebbe apparire il men contestuale: cliccate col bottone sinistro su "Apri link nel browser" o qualcosa di simile e dovrebbe iniziare la navigazione.

Se ancora non accade nulla, visualizzate il codice sorgente della presente pagina html, individuate e copiate il link nell'url del vostro browser.

Il sito utilizza tecnologia javascript, pertanto in caso di malfunzionamento necessario che verifichiate che sul vostro browser sia attivata l'esecuzione di javascript e che abbiate installata una versione recente del browser.

ATTENZIONE: il link destinato a vostro esclusivo uso e dei vostri familiari. Non deve essere diffuso e non deve essere divulgato a terzi. Pu essere revocato in qualunque momento dall'amministratore di sistema a suo insindacabile giudizio per qualunque motivo.

Se il link scaduto o non funziona potete richiederne uno in sostituzione a chi vi ha dato questo spiegando i motivi.

Siccome il link baypassa la homepage, ai sensi dell'art. 13 D.Lgs 196 del 2003 vi avvisiamo che il sito che andrete a visitare tramite il link fa uso esclusivo di cookies tecnici. Per una pi esauriente spiegazione sull'uso dei cookies da parte del nostro sito vi invitiamo a visitare www.grafichecagnasso.it

ATTENZIONE: il catalogo online (a differenza di quello cartaceo in dotazione presso i nostri rivenditori) ha funzione prettamente indicativa pertanto i colori e l'aspetto visualizzati dei prodotti potrebbero differire dai prodotti finiti.

 

Invio automatizzato: non rispondere a questa e-mail (potrebbe venire ignorata)

[/code]

sorry… Thunderbird read and visualize correctly,
but is google chrome to not work well when I read mail on webmail…

[quote=227204:@Marco Cagnasso]sorry… Thunderbird read and visualize correctly,
but is google chrome to not work well when I read mail on webmail…[/quote]

That page works well in Chrome as it is. I suspect the web mail client i using CP-1252 instead of UTF-8 or something of that nature.

You may be able to overcome that by using HTML entities in your code. https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Chances are “é” in your page code will display correctly, instead of “é”. As Italian does not need many accented characters, a quick series of search and replace will probably suffice.

@Marco Cagnasso
You could try CURLEmailMBS class as an alternative from our plugins.
It takes care of encoding of subject, body and names:

https://www.monkeybreadsoftware.net/class-curlemailmbs.shtml

there are a couple complaints about the html from validators

  1. <h4>Euro Grafica snc <br>ti d il benvenuto</h4>
    

the BR tag is unclosed

  1. Invio automatizzato: non rispondere a questa e-mail (potrebbe venire ignorata)

the STRONG tag is unclosed

In HTML, the
tag has no end tag. It is closed only in XHTML.

I used a file generated from Dremweawer, and after cut some lines,
but I do not know HTML & Co…

Is my file an HTML or XHTML file?

Which his document claims to be

Oops.

questa non ? una risposta anzi confonde solo… comunque grazie

With absolutely no details, an answer would require a crystal ball…