Command Line inserted images

Discussion of features in Mozilla Thunderbird
Posts: 2
Joined: April 2nd, 2018, 11:31 am

Post Posted April 2nd, 2018, 12:04 pm


I need insert some image in a thunderbird mail and send, with command line, i check the attachment argument, but the image appear as attachment file and not is showed in the body of the message.

What is the argument to insert some image i can refer inside the mail body?

Thanks in advance

Posts: 3479
Joined: February 3rd, 2009, 6:29 pm

Post Posted April 2nd, 2018, 8:06 pm

You can generate the email from the command line, but Thunderbird still requires the send button to be clicked.

You can use the message argument to specify a plain text or an HTML file for the body of the mail.

Here is a VBScript example.


An A-Z Index of Windows VBScript commands

Command line arguments ... hunderbird

Compose arguments e.g. args.subject ... ommands.js

* example.vbs

Code: Select all
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Exec("C:\Program Files\Mozilla Thunderbird\thunderbird.exe -compose" & _
  " preselectid='id1'" & _
  ",from=''" & _
  ",to='foo bar <>'" & _
  ",cc=''" & _
  ",bcc=''" & _
  ",newsgroups=''" & _
  ",newshost=''" & _
  ",subject='abracadabra'" & _
  ",message='C:\example.htm'" & _
  ",body=''" & _
  ",attachment='C:\example.txt'" & _
  ",bodyislink='false'" & _
  ",type='0'" & _
  ",format='0'" & _
  ",originalMsgURI=''" & _
Set objShell = Nothing

* example.htm

Code: Select all
This text is <b>bold</b><br>
This text is <i>italic</i><br>
This text is <u>underline</u><br>
This text is <strike>strikethrough</strike><br>
<p><img src="file:///C:/example.png" alt="alternate text">

* example.txt

Code: Select all
This is an attachment file.


Thunderbird has blocked a file from loading into this message. Unblocking the file will include it in your sent message.

You need to unblock the example.png file before the image shows up in the compose window.

More info: viewtopic.php?f=39&t=3029707

Posts: 2
Joined: April 2nd, 2018, 11:31 am

Post Posted April 3rd, 2018, 4:29 pm

Thanks a lot with your explanation finally works

Return to Thunderbird Features

Who is online

Users browsing this forum: No registered users and 1 guest