Question

I have a standard whole Mime source text string I need converted to either a Java or PHP object (or both if you want to show off !) so it can be manipulated in these platforms. I have looked everywhere but only seem to be able to create from scratch. So the below for example becomes an object that I can change headers or body parts, and the resend using the provided classes.

The require application for this is a distributed one, where I can supply customers a small java program while their local email app can point SMTP to, which I have done, and obtained Mime string as below.

I then want to be able to access and manipulate the various parts like headers and individual body parts before sending. Surely there is some class or library which will offer this ? If necessary I can simply send the string to a PHP script if there is a suitable solution in PHP however its on a shared server so I cannot simply add PHP extensions.

Return-path: <tim@domain_a.com>
Envelope-to: XXXXXXXXXXXX
Delivery-date: Thu, 19 Sep 2013 09:54:17 +0100
Received: from XXXXXXXXXX [61.125]:62344 helo=[192.168.1.10])
    by leopard.host-ns.co.uk with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256)
    (Exim 4.80.1)
    (envelope-from <tXgham@dXm>)
    id 1VMa09-000MOc-4T
    for tiXham@daXcs.com; Thu, 19 Sep 2013 09:54:17 +0100
Message-ID: <523ABBB6.1080105@datXics.com>
Date: Thu, 19 Sep 2013 09:54:14 +0100
From: Txgham <tiXam@datXics.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: TiXham <tiXam@daXics.com>
Subject: Re: Example
References: <523ABB49.50403@daXnics.com>
In-Reply-To: <523ABB49.50403@daXhanics.com>
Content-Type: multipart/alternative;
 boundary="------------000900010104080404030103"

This is a multi-part message in MIME format.
--------------000900010104080404030103
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Example showing reply subpart and HTML <apage.html>

On 19/09/2013 09:52, TiXgham wrote:
> Example email


--------------000900010104080404030103
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <a href="apage.html">Example showing reply subpart and HTML</a> <br>
    <br>
    <div class="moz-cite-prefix">On 19/09/2013 09:52, TiXam wrote:<br>
    </div>
    <blockquote cite="mid:523ABB49.50403@daXanics.com" type="cite">Example
      email
      <br>
    </blockquote>
    <br>
  </body>
</html>

--------------000900010104080404030103--
Was it helpful?

Solution

This is out of date now and never did fully solve it. The issue was deemed as platform specific (iPhone) and not relevant after so much time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top