Add the Headers to the Part
Add the headers to the part using the insertHeader() function, for example:
message.insertHeader(from);
The MIME specification requires that a MIME message contain a MIME-Version header. Be sure to insert the header into a part that will be used as a top-level message, as shown below:
message.insertHeader(version);