Bonjour,
J'ai cherché sur les différentes discutions un code pour envoyer un mail. Malheureusement toutes les discutions sont close et j'ai une erreur dans le miens.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 Sub EnvoiMail() 'Add the Project Reference Microsoft CDO WINDOWS FOR 2000 Dim cdo_msg As New CDO.Message 'configuration message cdo_msg.Configuration.Fields(cdoSMTPServer) = "smtp.gmail.com" cdo_msg.Configuration.Fields(cdoSMTPConnectionTimeout) = 60 cdo_msg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort cdo_msg.Configuration.Fields(cdoSMTPServerPort) = 465 cdo_msg.Configuration.Fields(cdoSMTPAuthenticate) = cdoBasic cdo_msg.Configuration.Fields(cdoSMTPUseSSL) = True cdo_msg.Configuration.Fields(cdoSendUserName) = "Mon_ID" cdo_msg.Configuration.Fields(cdoSendPassword) = "Mon_PW" cdo_msg.Configuration.Fields.Update 'remplissage et envoi message cdo_msg.To = "emai@gmail.com" cdo_msg.From = "emai@gmail.com" cdo_msg.Subject = "filename Sent to www.???.com " cdo_msg.TextBody = "File FTP LOG ATTACHED." ' cdo_msg.AddAttachment ("C:\Users\nnnnnn\Documents\classeur1.xls") cdo_msg.Send 'libération objet message Set cdo_msg = Nothing End Sub
Merci d'avance de votre aide.
A bientôt
Partager