Change body ContentType

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

Change body ContentType

Post by hungrycop »

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.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Change body ContentType

Post by tanstaafl »

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

Re: Change body ContentType

Post by hungrycop »

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,
                            "");
Post Reply