GAE/JavaMail sending an attachment not working
===

No problem sending or forwarding e-mails. However, when I attempt to send and attachment as mime multipart, the attachment does not get sent. I've scoured existing posts and tried multiple ways to fix. The low level MailService works, but JavaMail does not. I'll post both code snippets, and hopefully someone will have an answer.

The sender is an app admin, but has been changed in the snippets.

What works, here's the low level API call:
    
            String htmlBody = "Data dump from " + host + ". See attached.";
    		Properties props = new Properties();
            Session session = Session.getInstance(props, null); // not used
			MailService service = MailServiceFactory.getMailService();
			MailService.Message msg = new MailService.Message();
			msg.setSender("myUser@gmail.com");
			msg.setTo("anotherUser@gmail.com");
			msg.setSubject("Committee Participation Report");
			msg.setHtmlBody(htmlBody);
			MailService.Attachment attachment = new MailService.Attachment("data-dump.cvs",
					report.getBytes());
			msg.setAttachments(attachment);
			service.send(msg);

What doesn't work, the JavaMail API call:

		Properties props = new Properties();
		Session session = Session.getInstance(props, null);
		Message msg = new MimeMessage(session);
		msg.setFrom("admins");
		msg.addRecipient(Message.RecipientType.TO, "aUser@gmail.com");
		msg.setSubject("a subject");
		
		Multipart mp = new MimeMultipart();
		
		MimeBodyPart htmlPart = new MimeBodyPart();
		htmlPart.setContent(htmlBody, "text/html");		
		mp.addBodyPart(htmlPart);

		MimeBodyPart attachment = new MimeBodyPart();
		attachment.setDataHandler(new DataHandler(new ByteArrayDataSource(attachmentData, contentHeader)));
		attachment.setFileName(fileName);		
		mp.addBodyPart(attachment);

		msg.setContent(mp);
		Transport.send(msg);

It would be nice to use the same API for e-mail with or without attachments, so if anyone has been able to get the JavaMail API to send attachments, I would like to know how.