out.println("From: " + encode(aMail.getFrom(), ContentType_Charset));
out.println("From: " + encode64Address(aMail.getFrom()));
	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						if(ContentType_Charset == "")										//set default charset if requied				ContentType_Charset = "UTF-8";															//write the message headers			out.println("From: " + encode(aMail.getFrom(), ContentType_Charset));			for(int x = 0; x < aMail.countTo(); x++)			{					out.println("To: " + encode(aMail.getTo(x), ContentType_Charset));			}			for(int x = 0; x < aMail.countCC(); x++)			{					out.println("CC: " + encode(aMail.getCC(x), ContentType_Charset));			}			for(int x = 0; x < aMail.countBCC(); x++)			{					out.println("BCC: " + encode(aMail.getBCC(x), ContentType_Charset));			}			out.println("Date: " + getDateRFC822());			out.println("Subject: " + encode(aMail.getSubject(), ContentType_Charset));			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(encode("Error your mail client is not MIME Compatible", ContentType_Charset));								//send the text part first 				out.println("--" + MultipartBoundary);				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);				out.println("Content-Type: text/html; charset=" + ContentType_Charset);				out.println("Content-Transfer-Encoding: quoted-printable");				out.println(encode("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">", ContentType_Charset));				out.println(encode(aMail.getXHTML(), ContentType_Charset));								//Emd multipart message				out.println("--" + MultipartBoundary + "--");							}			else			{				//No, is it a text email				if(!aMail.getText().toString().equals(""))				{					//Yes, text email					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(encode(aMail.getText(), ContentType_Charset));				}				else				{					//No, its a HTML email					out.println("Content-Type: text/html; charset=" + ContentType_Charset);					out.println("Content-Transfer-Encoding: quoted-printable");										//now send the html message					out.println();					out.println(encode("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">", ContentType_Charset));					out.println(encode(aMail.getXHTML(), ContentType_Charset));				}			}						//end the message, <cr><lf>.<cr><lf>			out.println();			out.println(".");			out.println();			out.flush();	}