out.println("Content-Type: text/plain; charset=" + ContentType_Charset);
out.println("Content-Type: text/html; charset=" + ContentType_Charset);
	private void WriteMessage(PrintWriter out, mail aMail, String ContentType_Charset) throws IOException	{			String Version = eXistVersion();									//Version of eXist			String MultipartBoundary = "eXist.multipart." + Version;			//Multipart Boundary						//write the message headers			out.println("From: " + aMail.getFrom());			for(int x = 0; x < aMail.countTo(); x++)			{					out.println("To: " + aMail.getTo(x));			}			for(int x = 0; x < aMail.countCC(); x++)			{					out.println("CC: " + aMail.getCC(x));			}			for(int x = 0; x < aMail.countBCC(); x++)			{					out.println("BCC: " + aMail.getBCC(x));			}			out.println("Date: " + new Date());			out.println("Subject: " + aMail.getSubject());			out.println("X-Mailer: eXist " + Version + " util:send-email()");			out.println("MIME-Version: 1.0");						//Is this a multipart message i.e. text and html?			if((!aMail.getText().toString().equals("")) && (!aMail.getXHTML().toString().equals("")))			{				//Yes, start multipart message				out.println("Content-Type: multipart/alternative; boundary=\"" + MultipartBoundary + "\";");								//Mime warning				out.println("Error your mail client is not MIME Compatible");								//send the text part first 				out.println("--" + MultipartBoundary);				if(ContentType_Charset == "")				{					out.println("Content-Type: text/plain; charset=UTF-8");				}				else				{					out.println("Content-Type: text/plain; charset=" + ContentType_Charset);				}				out.println("Content-Transfer-Encoding: quoted-printable");				out.println(aMail.getText());								//send the html part next				out.println("--" + MultipartBoundary);				if(ContentType_Charset == "")				{					out.println("Content-Type: text/plain; charset=UTF-8");				}				else				{					out.println("Content-Type: text/plain; charset=" + ContentType_Charset);				}				out.println("Content-Transfer-Encoding: quoted-printable");				out.println(aMail.getXHTML());								//Emd multipart message				out.println("--" + MultipartBoundary + "--");							}			else			{				//No, is it a text email				if(!aMail.getText().toString().equals(""))				{					//Yes, text email					if(ContentType_Charset == "")					{						out.println("Content-Type: text/plain; charset=UTF-8");					}					else					{						out.println("Content-Type: text/plain; charset=" + ContentType_Charset);					}					out.println("Content-Transfer-Encoding: quoted-printable");										//now send the trxt message					out.println();					out.println(aMail.getText());				}				else				{					//No, HTML email					if(ContentType_Charset == "")					{						out.println("Content-Type: text/plain; charset=UTF-8");					}					else					{						out.println("Content-Type: text/plain; charset=" + ContentType_Charset);					}					out.println("Content-Transfer-Encoding: quoted-printable");										//now send the html message					out.println();					out.println(aMail.getXHTML());				}			}						//end the message, <cr><lf>.<cr><lf>			out.println();			out.println(".");			out.println();			out.flush();	}