Salut!
j'aurais besoin de scripts permettant l'envoi de mails et de fax s'appuyant sur les objets CDO.
pour votre aide!
Salut!
j'aurais besoin de scripts permettant l'envoi de mails et de fax s'appuyant sur les objets CDO.
pour votre aide!
Bonjour,
Un bout de code :
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188 <%@ Language=VBScript %> <HTML> <HEAD> <title> </title> </HEAD> <BODY bgcolor="#fefceb"> <p align="center"> <font face="Arial" color="#0099cc" size="4"> <strong> Envoi du courrier <br><br> </strong> </font> </p> <br><br><br> <form name="frmSaisie" method="post" action="Envoyer.asp"> <input type="hidden" name="txtLettre" value="<%=Str_Lettre%>"> <table align="center" border="0"> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Sujet : </strong> </font> </td> <td> <input type="text" name="txtSujet" value="Lettre" size="50"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> De la part de : </strong> </font> </td> <td> <input type="text" name="txtFrom" size="50"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Expéditeur : </strong> </font> </td> <td> <input type="text" name="txtSender" size="50"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Option des destinataires : </strong> </font> </td> <td> <font face="Arial" color="#0099cc" size="2"> <strong> A : </strong> </font> <input type="radio" name="txtOption" value="OptionA"> <font face="Arial" color="#0099cc" size="2"> <strong> Cc : </strong> </font> <input type="radio" name="txtOption" value="OptionCc"> <font face="Arial" color="#0099cc" size="2"> <strong> Cci : </strong> </font> <input type="radio" checked name="txtOption" value="OptionCci"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Importance : </strong> </font> </td> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Basse : </strong> </font> <input type="radio" name="txtImportance" value="0"> <font face="Arial" color="#0099cc" size="2"> <strong> Normale : </strong> </font> <input type="radio" checked name="txtImportance" value="1"> <font face="Arial" color="#0099cc" size="2"> <strong> Haute : </strong> </font> <input type="radio" name="txtImportance" value="2"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> <font face="Arial" color="#0099cc" size="2"> <strong> Source du message : </strong> </font> </td> <td> <input type=file name=browse style="display: none;"> <input type=text name=file size="50"> <input type=button onClick="browse.disabled=false;browse.click();file.value=browse.value;browse.disabled=true" value=" . . . "> </td> </tr> </table> <br><br><br><br> <p align="center"> <input type="submit" name="cmdEnvoyer" value="Envoyer"> </p> </form> </BODY> </HTML>
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
56
57
58
59
60
61
62
63
64
65
66
67 <% Set oMail = Server.CreateObject("CDO.Message") Set oMailConfig = Server.CreateObject ("CDO.Configuration") oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Application("ServerSMTP") oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 oMailConfig.Fields.Update Set oMail.Configuration = oMailConfig oMail.Sender = Replace(Request.Form("txtSender"), " ", "<space>") 'oMail.ReplyTo = "Mezigue@ici.fr" oMail.From = Request.Form("txtFrom") Recip = "A1@ici.fr;A2@ici.fr" select case Request.Form("txtOption") case "OptionA" oMail.To = Recip case "OptionCc" oMail.Cc = Recip case "OptionCci" oMail.Bcc = Recip end select oMail.Fields("urn:schemas:httpmail:importance").value = Request.Form("txtImportance") oMail.Fields.Update() oMail.Subject = Request.Form("txtSujet") 'oMail.HTMLBody = "<b>Contenu du message ...</b>" & vbcrlf ' HTML 'oMail.TextBody = "suite du contenu" ' TEXTE if len(trim(Request.Form("file"))) > 0 then oMail.CreateMHTMLBody "file://" & Request.Form("file") end if oMail.Send Set oMailConfiguration = Nothing Set oMailConfig = Nothing Set oMail = Nothing if Err = 0 then %> <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> </HEAD> <BODY bgcolor="#fefceb"> <br><br><br><br><br><br><br><br> <P align="center"> <font face="Arial" color="#0099cc" size="3"> <strong> Message envoyé avec succès. </strong> </font> </P> <br><br><br><br> </BODY> </HTML> <% end if %>
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager