(sTextHtml==null ? sTextPlain : sTextHtml), null, null, null);
if (aAttachments!=null) {
Integer oPart = DBCommand.queryMaxInt(oCon, DB.id_part, DB.k_mime_parts, DB.gu_mimemsg+"='"+oMsg.getMessageGuid()+"'");
if (oPart==null) oPart = new Integer(1);
PreparedStatement oStm = oCon.prepareStatement("INSERT INTO " + DB.k_mime_parts + "("+DB.gu_mimemsg+","+DB.id_message+","+DB.id_part+","+DB.id_disposition+","+DB.id_content+","+DB.id_type+","+DB.len_part+","+DB.de_part+","+DB.file_name+") VALUES ('"+oMsg.getMessageGuid()+"',?,?,'reference',?,?,?,?,?)");
for (int p=0; p<aAttachments.length; p++) {
String sFilePath = Gadgets.chomp(sUserDir,File.separator)+aAttachments[p];
File oAttach = new File(sFilePath);
if (oAttach.exists()) {
oStm.setString(1, sMsgId);