public void setParts(List<Content> parts) {
		this.parts = parts;
		if (parts != null && !parts.isEmpty() && contentType == null) {
			// Check if there is a smil inside
			Content smil = null;
			for (Content c : parts) {
				if (c.getContentType().contains("smil")) {
					smil = c;
					break;
				}
			}

			this.boundary = "==Multipart==" + UUID.randomUUID().toString();
			if (smil == null) {
				setContentType("multipart/mixed; boundary=\"" + boundary + "\"");
			} else {
				String smilcontentType = smil.getContentType();
				if (smilcontentType.indexOf(";")!=-1) {
					smilcontentType = smilcontentType.substring(0, smilcontentType.indexOf(';'));
				}
				setContentType("multipart/related; start=\"<" + smil.getContentId() + ">\"; type=\"" + smilcontentType
						+ "\"; boundary=\"" + boundary + "\"");
			}
		}
	}