message.setText(buffer.toString());
message.setText("");
    public void send() throws Exception {        if (buffer != null) {            // if we also have a multipart body, add            // plain string as first part to it.            if (multipart != null) {                MimeBodyPart part = new MimeBodyPart();                part.setContent(buffer.toString(), "text/plain");                multipart.addBodyPart(part, 0);                message.setContent(multipart);            } else {                message.setText(buffer.toString());            }        } else if (multipart != null) {            message.setContent(multipart);        } else {            message.setText("");        }        Transport.send(message);    }