Sub Mail_Thunderbird_et_PJ()
'Code et commentaires de conil26 (Merci !)
Dim destinataire, sujet, fichierjoint As String
Dim leNumero As String ' leNumero$ est le n° du dossier et du fichier
destinataire = "framboise@live.fr" 'leMail1$
sujet = "Email avec Thunderbird et PJ"
text1 = "Bonjour " & "<br><br>" ' & "<br><br>" correspond à une ligne vide
text2 = "bla bla." & "<br><br>"
text3 = "Il s 'agit d'un fichier pdf." & "<br>" ' & "<br>" correspond à un simple retour à la ligne
text4 = "Si vous n'avez pas le logiciel Adobe Reader gratuit" & "<br>"
text5 = "vous pouvez le télécharger à l'adresse ci-dessous :" & "<br>"
text6 = "http://get.adobe.com/fr/reader/"
body = text1 & text2 & text3 & text4 & text5 & text6 ' Assemblage de tous les éléments du texte final
fichierjoint = "C:\Users\DoubleZero\Downloads\Toto.xls" ' Votre chemin et le fichier que vous voulez avec l'extension que vous voulez. Vous pouvez aussi mettre le chemin en dur."
strcommand = "C:\Program Files (x86)\Mozilla Thunderbird\Thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire & "'" ' Toutes les lignes de strcommand se terminent par une apostrophe encadrée de guillements doubles.
strcommand = strcommand & "," & "bcc='" & leMail2$ & "'"
strcommand = strcommand & "," & "subject='" & sujet & "'"
strcommand = strcommand & "," & "format='" & 1 & "'"
strcommand = strcommand & "," & "body='" & body & "'"
strcommand = strcommand & "," & "attachment=file:///" & fichierjoint
MsgBox strcommand
Call Shell(strcommand, vbNormalFocus)
End Sub