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 _
("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp.miosmtp.it"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...tpauthenticate") = cdoBasic
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...n/sendusername") = "miamail.it"
'Your password on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...n/sendpassword") = "password"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...smtpserverport") = 25
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...ion/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 60
objmessage.Configuration.Fields.Update
objmessage.Send
RS.MoveNext
Loop
End If
MsgBox "Inviate " & rstotale & " messaggi email!"
end sub
Thanks and Regards