Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question<html> <head> <HTA:APPLICATION ICON="icon.ico" APPLICATIONNAME = "SMTP Mail Client" BORDER="dialog" BORDERSTYLE="complex" CONTEXTMENU="no" SYSMENU="yes" MAXIMIZEBUTTON="no" SCROLL="no" > <title>SMTP Mail Client © Hackoo</title> <META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> body{ background-color: lightblue; } label,.btn{ font-weight: bold; } </style> <script language="VBScript"> Const cdoSendUsingPickup = 1 Const cdoSendUsingPort = 2 Const cdoAnonymous = 0 Const cdoBasic = 1 Const cdoNTLM = 2 'NTLM 'Delivery Status Notifications Const cdoDSNDefault = 0 Const cdoDSNNever = 1 Const cdoDSNFailure = 2 Const cdoDSNSuccess = 4 Const cdoDSNDelay = 8 Const cdoDSNSuccessFailOrDelay = 14 messageSSLHTML = "<center>Ceci est un exemple de message en HTML. Il a été envoyé en utilisant l'authentification SMTP et SSL. " Signature = "<center> © "" Then objMessage.AddAttachment sFilePath1 End If objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = sFrom objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = sPassword objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True objMessage.Configuration.Fields.Update On Error Resume Next objMessage.Send SendGmailSSL = Err.Number If Err.Number <> 0 Then MsgBox Err.Description, 16, "SendGmailSSL Erreur" End If End Function Sub window_onload() CenterWindow 415, 600 End Sub Sub CenterWindow(x,y) window.resizeTo x, y iLeft = window.screen.availWidth/2 - x/2 itop = window.screen.availHeight/2 - y/2 window.moveTo ileft, itop End Sub Sub SendMail() 'Formater le textaera au format html Dim st,i,tb,paragraphe st=txtbody.value tb = split(st,vbcrlf) For i = lbound(tb) to ubound(tb) paragraphe=paragraphe & tb(i) & " " & vbcrlf Next SendMailMessage txtFrom.Value, txtTo.Value, txtSubject.Value, paragraphe ,txtSMTPSERVER.Value, file.Value End Sub Sub SendMailMessage( sFrom, sTo, sSubject, sBody, SMTPSERVER, File) MsgBox "Envoi du Mail avec ces options:"& vbCrLf &"Expéditeur: "& sFrom & vbCrLf & "To: " & sTo & vbCrLf &"Sujet: " & sSubject & vbCrLf &"Text Message: " & sBody & vbCrLf & "SMTP SERVER: " & SMTPSERVER & vbCrLf & "Piéce-jointe: " & File,64,"Send Email" messageHTML="<center>Ceci est un exemple de message avec Signature en HTML envoyé par Hackoo !" File = document.getElementById("file").Value Set msg = CreateObject("CDO.Message") With msg .From = sFrom .To = sTo .Subject = sSubject .TextBody = sBody .HTMLBody=sBody & messageHTML & Signature .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPSERVER .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 If File <> "" Then .AddAttachment File 'Ajout de la piéce-jointe End If .Configuration.Fields.Update On Error Resume Next .Send If Err.Number <>0 Then MsgBox Err.Description,16,"Error Sending Mail" Else MsgBox "Le Mail a été envoyé avec succès !",64,"Information" End If End With End Sub </script> </head> <label for="Expéditeur" style="width: 120; textalign: right;">Expéditeur:</label> <label for="to" style="width: 120; textalign: right;">Destinataire:</label> <label for="subject" style="width: 120; textalign: right;">Sujet:</label> <label for="txtSMTPSERVER" style="width: 120; textalign: right;">SMTP:</label> <label for="file">Pièce-Jointe :</label> <label>Message:</label> <textarea id="txtBody" rows="20" cols="45"></textarea> <center> </html>