Bonjour,
je voudrais automatisé l'envoi de mail via Outlook express .
Merci de me mettre sur des pistes .
Bonjour,
je voudrais automatisé l'envoi de mail via Outlook express .
Merci de me mettre sur des pistes .
Bonjour
Outlook Express n'est pas pilotable par VBA.
Tu as cette solution dans lahttp://access.developpez.com/faq/?pa...ailPieceAttach
Bonjour
j'ai une erreur sur le code de la FAQ .
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 Public Sub CDOSendMail(SendFrom As String, SendTo As String, Subject As String, PlainTextBody As String, FullPathFileName As String) Dim cdoMail As CDO.Message Dim iBp As CDO.IBodyPart ' for IBodyPart on message Dim iBp1 As CDO.IBodyPart Dim Flds As ADODB.Fields Dim Stm As ADODB.Stream Set cdoMail = New CDO.Message With cdoMail .From = SendFrom .To = SendTo .Subject = Subject ''Set iBp = .BodyPart Set iBp = cdoMail '?? ' TEXT BODYPART ' Add the body part for the text/plain part of message Set iBp1 = iBp.AddBodyPart ' set the fields here Set Flds = iBp1.Fields Flds("urn:schemas:mailheader:content-type") = "text/plain; charset=""iso-8859-1""" Flds.Update ' get the stream and add the message Set Stm = iBp1.GetDecodedContentStream Stm.WriteText PlainTextBody Stm.Flush ' HTML BODYPART ' Do the HTML part here Set iBp1 = iBp.AddBodyPart ' set the content-type field here Set Flds = iBp1.Fields Flds("urn:schemas:mailheader:content-type") = "text/html" Flds.Update ' get the stream and add message HTML text to it Set Stm = iBp1.GetDecodedContentStream Stm.WriteText "<HTML><H1>this is some content for the body part object</H1></HTML>" Stm.Flush ' Now set the Message object's Content-Type header ' to multipart/alternative Set Flds = iBp.Fields Flds("urn:schemas:mailheader:content-type") = "multipart/alternative" Flds.Update .AddAttachment FullPathFileName .Send End With End Sub
au niveau de " Dim Stm As ADODB.Stream" il reconnais pas ??
j'ai rajouté les library comme indiqué dans la FAQ
DES IDEES ???
MERCI
Partager