Sub Envoie_mail(destinataire)
On Erreur GoTo Erreur_envoie
ActiveWindow.Close
Dim iConf As Object
Dim Flds
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.orange.fr"
.Update
End With
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = destinataire
.From = "xxxxxxxxx@orange.fr"
.Subject = "Calendrier des congés " & Nom_equipe
.TextBody = "Bonjour" & Chr$(13) & Chr$(10) & "" & Chr$(13) & Chr$(10) & " Merci de nous retourner le fichier AU PLUS TARD le dernier jour d'arrètés des paies en cliquant sur le bouton 'RETOUR DU FICHIER'" & Chr$(13) & Chr$(10) & "" & Chr$(13) & Chr$(10) & Chr$(13) & Chr$(10)
.AddAttachment (ThisWorkbook.Path & "/" & Nom_equipe & ".xls")
.Send
End With
Exit Sub
Erreur_envoie:
MessageErreur3 = MsgBox("UNE ERREUR C'EST PRODUITE LORS DE L'ENVOI D'UN FICHIER", vbExclamation, "APPLICATION CONGES")
End
End Sub