Envoi de mail avec vbscript
Bonjour,
je veut savoire comment envoyé un mail par un script vbs
je veut savoire comment envoyé un mail par un script vbs
Configuration: Windows XP Internet Explorer 6.0
19 réponses
-
S'il vous plaît ?
Merci d'avance ?
http://www.commentcamarche.net/ccmguide/ccmcharte respect autrui.php3#politesse
-
bon soire j'utilise ce scripte c'a l'aire d'etre tres bien marcher mais je ne recois aucun message ?
With CreateObject("CDO.Message")
.From="hamza_0081@commentcamarche.com"
.To="hamza_0081@commentcamarche.com"
.Subject="test pour envoie de mail"
.TextBody="Bonjour," & Chr(13) & "Ceci est un test " & Chr(13) & "Cordialement"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "raoul.commentcamarche.org"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
On Error Resume Next
.Send
If Err.Number <>0 Then
MsgBox Err.Description,16,"Erreur"
End If
msgbox "mail bien envoyé"
On Error GoTo 0
End With -
With CreateObject("CDO.Message")
.From="toto@gmail.com"
.To="hamza_0081@commentcamarche.com"
.Subject="test pour envoie de mail"
.TextBody="Bonjour," & Chr(13) & "Ceci est un test " & Chr(13) & "Cordialement"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "raoul.commentcamarche.org"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
On Error Resume Next
.Send
If Err.Number <>0 Then
MsgBox Err.Description,16,"Erreur"
End If
msgbox "mail bien envoyé"
On Error GoTo 0
End With -
ok ! merci pour tous je vais esseyer le seveur !
bon soire bye :-) -
de tte facon le serveur smtp pour google est stmp.gmail.com
je dois partir ms je regarde cela demain
Bonne soiree -
avant j'utilise le serveur smtp183.google.com
-
en bref je ne suis pas sur ? je croie que g un ereure qu'el que part :-(
-
pour avoire cette adress g fait
1.lancer cmd
2.tapez nslookup
3.tapez set q=mx
4.tapez google.com
et la resulta est
[[
> set q=mx
> google.com
Non-authoritative answer:
google.com MX preference = 10, mail exchanger = smtp2.google.com
google.com MX preference = 10, mail exchanger = smtp3.google.com
google.com MX preference = 10, mail exchanger = smtp4.google.com
google.com MX preference = 10, mail exchanger = smtp1.google.com
google.com nameserver = ns4.google.com
google.com nameserver = ns1.google.com
google.com nameserver = ns2.google.com
google.com nameserver = ns3.google.com
smtp1.google.com internet address = 209.85.237.25
smtp2.google.com internet address = 64.233.165.25
smtp3.google.com internet address = 64.233.183.25
smtp4.google.com internet address = 72.14.221.25
ns1.google.com internet address = 216.239.32.10
ns2.google.com internet address = 216.239.34.10
ns3.google.com internet address = 216.239.36.10
ns4.google.com internet address = 216.239.38.10
> google.com>>googl.txt
Unrecognized command: google.com>>googl.txt
>
]]
g apris ce si sur le net je untilise cette methode pour connaitre le serveur et pius pour envoyez des eamils
via le cmd avec la connade telnet smtp3.google.com 25
aujourdhuis ce ne marche plus sur google -
tu es sur de ton adresse smtp (google) ?
sinon je verifie tout a l'heure
Farid -
ca ne foncionne toujour pas il m'affiche un message " the transport failed to connecte to the server "
et autre message dit que le message a ete bien evoyé ?
l'orsque g je verifier ma boite il n'ya pas de message ?
[[With CreateObject("CDO.Message")
.From="toto@gmail.com"
.To="hamza0081@gmail.com"
.CC="hamza0081@gmail.com"
.Subject="test pour envoie de mail"
.TextBody="Bonjour," & Chr(13) & "Ceci est un test " & Chr(13) & "Cordialement"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "stmp3.google.com"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
On Error Resume Next
.Send
If Err.Number <>0 Then
MsgBox Err.Description,16,"Erreur"
End If
msgbox "mail bien envoyé"
On Error GoTo 0
End With -
bon, si ca fonctionne, c'est le principal.
Quant à la piece jointe, si u n'en as pas besoin, Supprime la ligne correspondante : ceci etait juste un exemple. C'est a toi de l'adapter.
Si tu as encore besoin d'aide, fais le directement savoir sur le forum, ne demande pas ... et je repondrai si possible...
Farid T -
ah ! g oublier de te dir que g cree un fichier c:\piecejointe.pdf
-
merci boucoups pour le script mais il y a un erreure de connection au server g legerment modifier votre script
[
With CreateObject("CDO.Message")
.From="toto@gmail.com"
.To="hamza0081@gmail.com"
.CC="CopieMail@Copiemail.com"
.Subject="test pour envoie de mail"
.TextBody="Bonjour," & Chr(13) & "Ceci est un test " & Chr(13) & "Cordialement"
.AddAttachment("c:\piecejointe.pdf")
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "ton serveur exchange par exemple si tu utilises outlook ds ta boite : mets y l'IP"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
On Error Resume Next
.Send
If Err.Number <>0 Then
MsgBox Err.Description,16,"Erreur"
End If
msgbox "mail bien envoyé"
On Error GoTo 0
End With ]
es que tu peut encors m'aider svp ? -
Voici un exemple pour envoyer un mail en vbs . Il y a plsrs methodes mais je prefere celle ci car on peut tout gerer (par des variables entre autre....). Et ca fonctionne tres bein chez moi ... :)
With CreateObject("CDO.Message")
.From="toto@gmail.com" // ici peut importe que l'email existe ou pas
.To="tonDestataire@destinataire.com"
.CC="CopieMail@Copiemail.com" // si tu desires mettre une personne en copie
.Subject="test pour envoie de mail" // objet du mail
.TextBody="Bonjour," & Chr(13) & "Ceci est un test " & Chr(13) & "Cordialement" // ton text
// et le chr(13) sert a aller a la ligne
.AddAttachment("c:\piecejointe.pdf")
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "ton serveur exchange par exemple si tu utilises outlook ds ta boite : mets y l'IP"
.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
On Error Resume Next
.Send
If Err.Number <>0 Then
MsgBox Err.Description,16,"Erreur"
End If
msgbox "mail bien envoyé"
On Error GoTo 0
End With
En espérant que cela t'aidera..
Farid T. -
bounjours merci pour votre aides , je tien de vs informer que g pas trouvez ce que je cherche
-
Bonjour,
Je vois que tu n'as pas de reponse. Je suppose que tu as trouvé la solution.... enfin j'espere pour toi :)
Si ton post est toujours d'actualité ,fais le moi savoir et je t'aiderai aussitot
Cdlt. -
merci en fin un qui comprand ce que je soufre !!
-
c'est bizar que tu n'ai pas de réponse :p
-
je veut savoire comment envoyé un mail par un script vbs
merci d'avonce les amies
et je suis désoler §§