How to create mail message in FRC822 format

Here is the RFC822 message sample format...which is accepted by archive mail server.
Date: Fri, 23 Sep 2011 11:33:37 +0530 (GMT+05:30)
Message-ID: <18916478.4.1316757817734.JavaMail.user@NIC-TestUser>
Subject: Test E-Mail through Java
MIME-Version: 1.0
Content-Type: multipart/mixed;

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This is part one of a test multipart e-mail.The second part is file as an attachment
Content-Type: text/plain; charset=us-ascii; name=testfile.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=testfile.txt


This is a test file.
How will you create this actual message format so that it can be send using java mail API ?


Popular posts from this blog

Struts 2 - struts tag with boolean property

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.