Windows 7 32 bits Family Premium installe sur un PC HP à la place du Windows Vista.
Problème : impossible d’envoyer les messages en utilisant différents clients smtp :
·
Incredimail
·
Les programmes développés en AutoIt en utilisant l’objet CDO.Message
Tous ces programmes fonctionnent correctement sur les autres PCs.
Les essais ont été faits avec l’envoi via le port 25 (sans authentification auprès du serveur) et via le port 465 via SSL
Les actions faites sans résultats:
**·**Réinitialisation couche IP (netsh int ip reset)
·
Application du fix
Microsoft Fix it 50199
Merci d’avance de votre l’aide pour remettre la couche TCP/IP en état de marche avec smtp (pas de problèmes constatés avec les navigateurs Internet).
La suite présente la trace d’envoi en utilisant l’objet CDO.Message et le code de la fonction Autoit utilisée. Les adresses e-mail ont été masquées.
Cordialement
User3D_441
Envoi sans authentification
SMTP: smtp.free.fr match: 1
smtp server = smtp.free.fr, $ssl = 0, $IPPort = 25, $Username = , $Password =
10/07/2013 11:40:25 Debut envoi courriel
$objEmail.To = ******@free.fr
- addLineToMessage(*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le protocole spécifié est inconnu.)
*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le protocole spécifié est inconnu.
- addLineToMessage(*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le transport a échoué dans sa connexion au serveur.)
*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le transport a échoué dans sa connexion au serveur.
10/07/2013 11:41:00 Fin envoi courriel
10/07/2013 11:41:00 syncDossierCDOx86.exe v03f: fin script - tous les traitements ont duree 36sec
Envoi via SSL
SMTP: smtp.laposte.net match: 1
smtp server = smtp.laposte.net, $ssl = 1, $IPPort = 465, $Username = ******@laposte.net, $Password = xxxx
10/07/2013 11:48:54 Debut envoi courriel
$objEmail.To = ******@free.fr
- addLineToMessage(*** COM Error !
Number: 80020009
ScriptLine: -1 Description:Le protocole spécifié est inconnu.)
*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le protocole spécifié est inconnu.
- addLineToMessage(*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le transport a échoué dans sa connexion au serveur.)
*** COM Error !
Number: 80020009 ScriptLine: -1
Description:Le transport a échoué dans sa connexion au serveur.
10/07/2013 11:49:30 Fin envoi courriel
10/07/2013 11:49:30 syncDossierCDOx86.exe v03f: fin script - tous les traitements ont duree 36sec
Script
Func emailCDO($to, $body)
Local $i
Local $body_text
Local $objEmail = ObjCreate("CDO.Message")
$objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
Local $toaddress = $to[1]
For $i = 2 To UBound($to) - 1
If $to[$i] Then $toaddress &= ", " & $to[$i]
Next
$objEmail.To = $toaddress
VerboseLine(8, "$objEmail.To = " & $toaddress)
Local $i_Error = 0
Local $i_Error_desciption = ""
$objEmail.Subject = $s_Subject
$body_text = $body[0]
For $i = 1 To UBound($body) - 1
$body_text &= @CRLF & $body[$i]
Next
$objEmail.Textbody = $body_text & @CRLF
If $OutputFileName <> "" Then
FileClose($f)
$objEmail.AddAttachment($OutputFileName)
EndIf
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= $s_SmtpServer
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= $IPPort
;Authenticated SMTP
If $Username <> "" Then
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $Username
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $Password
EndIf
If $ssl Then
$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
EndIf
;Update settings
$objEmail.Configuration.Fields.Update
; Set Email Importance
$objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Normal"
$objEmail.Fields.Update
; Sent the Message
$objEmail.Send
If @error Then
If $OutputFileName <> "" Then $f = FileOpen($OutputFileName, 1)
SetError(2)
Return $oMyRet[1]
EndIf
If $OutputFileName <> "" Then $f = FileOpen($OutputFileName, 1)
$objEmail = ""
EndFunc
;==>emailCDO
;-----------------------------------------------------------------
; Com Error Handler
Func MyErrFunc()
Local $HexNumber = Hex($oMyError.number, 8)
$oMyRet[0] = $HexNumber
$oMyRet[1] = StringStripWS($oMyError.description, 3)
VerboseLine(0, "*** COM Error ! Number: " & $HexNumber & "
ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1])
SetError(1); something to check for when this function returns
Return
EndFunc
;==>MyErrFunc