Bonjour,

Passé d'un système Windows 2000 à Windows 2003, j'ai changé de librairie pour l'envoi de message (CDONT à CDO).

Depuis l'encodage de caractère, dans mes mails de type HTML, tel que le signe "€" ne marche pas. Les utilisateurs reçoivent dans leur mail "?"

J'ai mis dans le <HEAD> :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
<HEAD><META http-equiv='Content-Type' 'Content-Type: text/html; charset=UTF-8'></HEAD>
j'ai essayé les options :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
.MimeFormatted = True
.GetStream.Charset = cdoISO_8859_15
.BodyPart.Charset = cdoISO_8859_15
.BodyPart.ContentTransferEncoding = "base64"
ça ne change rien.

Mon script :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
' Send by connecting to port 25 of the SMTP server.
Dim iMsg 
Dim iConf 
Dim Flds 
Dim strHTML
 
Const cdoSendUsingPort = 2
 
' TODO: Change these values to appropriate values for your environment
Const MySMTPServer = "monserveur" ' Name or IP address of SMTP server
Const MyToAddress = "mail@server.com" ' SMTP address to send message to
Const MyFromAddress = "monserveur@server.com" ' SMTP address to send message from
''''''''''''''''''''''''''''''
 
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
 
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
 
With Flds
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'Done: Enter name or IP address of remote SMTP server.
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MySMTPServer 
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'ToDo: Enter login/password
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
   .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
   .Update
End With
' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD><META http-equiv='Content-Type' 'Content-Type: text/html; charset=UTF-8'></HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>&euro;.</br>€"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
 
' Apply the settings to the message.
With iMsg
   Set .Configuration = iConf
   .To = MyToAddress
   .From = MyFromAddress
   .Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = strHTML
   .Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
 
MsgBox "Mail Sent!"
Merci de votre aide.