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)
From:sender@gmail.com
To:  archive@.............archive.psmtp.com
Cc:  archive@.............archive.psmtp.com
Message-ID: <18916478.4.1316757817734.JavaMail.user@NIC-TestUser>
Subject: Test E-Mail through Java
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="----=_Part_3_16554308.1316757817718"

------=_Part_3_16554308.1316757817718
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
------=_Part_3_16554308.1316757817718
Content-Type: text/plain; charset=us-ascii; name=testfile.txt
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=testfile.txt



Hi,

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

Comments

Popular posts from this blog

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

Upload csv file at Google Cloud Storage using java

Read Images from a xlsx file using Apache POI