Voici une fonction qui vous sera peut-être utile pour les "morning check" ou d'autres circonstances.
Elle est assez simple à configurer, les variables sont explicites.
Function SendMail(strTo, strBody, strTitre) Dim objMail,objConfig,objFields Set objMail = CreateObject("CDO.Message") Set objConfig = CreateObject("CDO.configuration") Set objFields = objConfig.Fields With objFields .Item("http://schemas.microsoft.com/cdo/configuration/SendUsing")= 2 'Définit le type d'envoi en SMTP .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "Serveur SMTP" .Item("http://schemas.microsoft.com/cdo/configuration/SMTPServerPort")= 25 .Update End With With objMail Set .Configuration = objConfig .To = strTo .Cc = strCc .Bcc = strBcc .From = "@d'envoi" .Subject = strTitre .HTMLBody = strBody .Send End With End Function
Voici l'appel de fonction :
Call SendMail(strTo, strMail, strSubject)
Proposer un script
|
Notre avis :

Votre avis :

Réactions : 0
Votants : 1
Visites : 4379
|