accented characters

remigio

New member
Local time
Yesterday, 20:09
Joined
Oct 8, 2014
Messages
2
Hi,
I'm using Access 2003 for sending emails via VBA using CDO as the code below.
This system works fine but I noticed that the accented characters as òàì etc are cutted or changed in the received email.
How can I set an appropriate charset on this code?


Dim db As Database, RS As Recordset
Set db = CurrentDb
Set RS = db.OpenRecordset("tabella", dbOpenDynaset)

RS.MoveLast
rstotale = RS.RecordCount

msg = MsgBox("Si desidera inviare " & rstotale & " messaggi email relativi all'esito della seduta del " _
& RS!data_visita, vbYesNo)
If msg = vbNo Then
Exit Sub
Else

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

RS.MoveFirst
Do Until RS.EOF

Set objmessage = CreateObject("CDO.Message")

objmessage.Subject = "Seduta U. V. M. del " & RS!data_visita
objmessage.From = """Unità di Valutazione Multidimensionale"" <mia mail.it>"
objmessage.To = RS!email
objmessage.TextBody = "Gentile dottore," & vbCrLf & "in data " & RS!data_visita _
& " si è riunita l'Unità di valutazione multidimensionale " _
& "che ha valutato la richiesta di " & RS!cognome & " " & RS!nome _
& " con il seguente esito: " & vbCrLf & RS!esito

objmessage.Configuration.Fields.Item _
(".....") = 2

objmessage.Configuration.Fields.Item _
(".......") = "smtp.miosmtp.it"

objmessage.Configuration.Fields.Item _
(".......") = cdoBasic

objmessage.Configuration.Fields.Item _
("........") = "miamail.it"

'Your password on the SMTP server
objmessage.Configuration.Fields.Item _
(".....") = "password"

objmessage.Configuration.Fields.Item _
(".......") = 25

objmessage.Configuration.Fields.Item _
("........") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objmessage.Configuration.Fields.Item _
(".......") = 60

objmessage.Configuration.Fields.Update

objmessage.Send

RS.MoveNext
Loop
End If

MsgBox "Inviate " & rstotale & " messaggi email!"

end sub

Thanks and Regards
 

Users who are viewing this thread

Back
Top Bottom