On Linux, there is a simple solution, using the utility "metasend. This requires creating an html file (ex: mail.html) containing the body of the message and referencing the images via an id. For example:
Voici une image : <img src="cid:id_001.gif">
We then use "metasend" to send the message as follows:
metasend -b
-F from@domewhere.com
-t someone@somewhere.com
-s "sujet du message"
-/ related
-m text/html -f mail.html
-n -m "image/gif" -f image1.gif -i '<id_001.gif>'
</id_001.gif>Explanation of Options (see here ): —b indicates that metasend fontionne in batch mode - F-address of the sender of the mail - Does the recipient’s address —s subject line - - / indicates that the mode of transmission MIME is "related" (ie multiple attachments together) —m indicates the type of the first attachment (text / html) —f name of the first to join —n indicates that it passes the second attachment —m gives its type (image / gif) —f file name of the second to join —i specifies the ID of the object (you can reference the href in mail body)
This last line (-n .../...) can be repeated as many times as there are pictures to attach, each time using a different ID.
Note: The type specified must reflect the real image type pain of not being able to display it in some cases (eg Internet Explorer in consultation with Gmail).