Script vbs pour envoyer un mail

cootz Messages postés 1 Date d'inscription lundi 19 janvier 2004 Statut Membre Dernière intervention 19 janvier 2004 - 19 janv. 2004 à 15:05
yjassim Messages postés 2 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 9 novembre 2004 - 29 mars 2004 à 19:11
Bonjour,

Je cherche à créer un script vbs qui permettra d'envoyer des mails automatiquement. Je ne peut pas ajouter de composants donc je cherche une méthode basée sur winsock ou autres ...

J'ai essayé des methodes comme : CreateObject("Outlook.Application") ou CreateObject("CDO.Message") mais rien ne marche.

Vous pouvez m'aider ???

1 réponse

yjassim Messages postés 2 Date d'inscription jeudi 31 juillet 2003 Statut Membre Dernière intervention 9 novembre 2004
29 mars 2004 à 19:11
dim objEmail

Set objEmail = CreateObject("CDO.Message")

'***************Build HTML for message body.**************

'strHTML = "<HTML>"

'strHTML = strHTML & "<HEAD>"

'strHTML = strHTML & ""

'strHTML = strHTML & " Gondol "

'strHTML = strHTML & ""

'strHTML = strHTML & "</HTML>"

objEmail.From = "from@from.from"

objEmail.To = "to@to.to"

objEmail.Subject = "Sujet"

'objEmail.HTMLBody = strHTML

Dim Attch

'Set Attch= objEmail.AddAttachment("c:\fichier")

objEmail.Textbody = "le corp du message"

objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.netcom.com"

objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objEmail.Configuration.Fields.Update

objEmail.Send

Set Attch= Nothing

Set objEmail= Nothing

yjassim
0
Rejoignez-nous