MozillaZine

Change body ContentType

Discussion of general topics about Mozilla Thunderbird
hungrycop
 
Posts: 3
Joined: February 15th, 2017, 12:22 pm

Post Posted February 15th, 2017, 12:38 pm

Is it possible to change body ContentType from plain/text to something else just before message is sent?
Now i rewrite default SendMessage function like that
Code: Select all
let oldSendMessage = SendMessage;
function SendMessage(){
    gMsgCompose.compFields.body = "test";
    oldSendMessage();
}

but I can't access body headers.

tanstaafl
Moderator

User avatar
 
Posts: 43364
Joined: July 30th, 2003, 5:06 pm

Post Posted February 16th, 2017, 9:11 am

Are you sending messages using the Thunderbird GUI, command line arguments, or the SimpleMAPI API? Or are you writing an add-on to use with Thunderbird? Some context would help.

hungrycop
 
Posts: 3
Joined: February 15th, 2017, 12:22 pm

Post Posted March 16th, 2017, 3:20 am

Actually I was looking for a way to send raw message within addon, I did it like this

Code: Select all
let msgSend = Components.classes["@mozilla.org/messengercompose/send;1"]
                                            .createInstance(Components.interfaces.nsIMsgSend);
msgSend.sendMessageFile(identity,
                            MailServices.accounts.defaultAccount.key,
                            composeFields,
                            message,
                            true ,
                            false ,
                            0,
                            null,
                            null,
                            null,
                            "");

Return to Thunderbird General


Who is online

Users browsing this forum: No registered users and 2 guests