Insérer image dans un tableau HTML envoyée par sendmail

Fermé
bob737 Messages postés 144 Date d'inscription jeudi 24 septembre 2009 Statut Membre Dernière intervention 14 mars 2024 - Modifié par teutates le 29/03/2016 à 17:47
bob737 Messages postés 144 Date d'inscription jeudi 24 septembre 2009 Statut Membre Dernière intervention 14 mars 2024 - 30 mars 2016 à 09:33
Bonjour,


J'envoie un mail par le script ci-dessous en utilisant sendmail, un tableau HTML dans lequel je souhaite inclure une image.

DST=toto@titi.com 
( 
echo "Subject:Rapport de sauvegarde " 
echo "to:$DST" 
echo "MIME-Version: 1.0" 
echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"' 
 
echo '---q1w2e3r4t5' 
echo "Content-Type: text/html" 
echo "Content-Disposition: attachment; filename=rapport_sauvegarde_TSM.html" 
cat $RESULTAT/rapport.html 
echo '---q1w2e3r4t5' 
 
echo "Content-Type: image/jpg;name="LOGO.jpg"" 
echo "Content-Transfer-Encoding: base64" 
echo "Content-Id: monlogo" 
echo "Content-Disposition: inline ; filename="LOGO.jpg"" 
uuencode -m $RESULTAT/LOGO.jpg LOGO.jpg 
 
echo '---q1w2e3r4t5' 
) | /usr/sbin/sendmail -f $DST $DST 
 
 
Dans mon fichier HTML, j'ai le code: 
<body> 
<img src="cid:monlogo" alt="monlogo"> 



et...je ne vois pas mon image dans le fichier. Pourtant, l'image est bien jointe au mail. Je ne vois pas mon erreur. :(
J'ai aussi essayé avec Content-Disposition: attachment, Je tourne en rond. :cry:

Merci de votre aide.
A voir également:

1 réponse

bob737 Messages postés 144 Date d'inscription jeudi 24 septembre 2009 Statut Membre Dernière intervention 14 mars 2024
30 mars 2016 à 09:33
Personne? ;-)
0