Open .eml file in compose mode in any client - email

I have composed a mail and stored as .eml file. I need to open this .eml file in compose mode with default email client application configured in the system.
Its getting opened in read mode. I went through all threads in stackoverflow. Everyone's solution is adding header X-Unsent: 1. Though I add this header in .eml file, It is getting opened in read mode. Am I missing anything here?
X-Unsent: 1
To: "Manikandan TK" <manirulz88#gmail.com>
Subject: Test
Date: Wed, 26 Apr 2017 08:56:52 +0000
Message-Id: <em206d8b63-c287-48b1-93ae-b9ac686e1bc7#jamshedpur>
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="------=_MB56B3DE95-5830-47CE-BE69-82C5C00F1F9A"

You simply can't get any email client to open a .eml file in compose mode just by changing the headers of the message. In fact, I'm almost 100% certain that won't work ever.
The best you can hope for is some command-line or way of scripting each individual email client to open the message in compose mode by some other means.
For that, you'll need to read the documentation for each email client you hope to support and/or read thru it's source code if it is open source. You might also have some luck emailing the developers of said client and asking them how to do it (if it's even possible).
I suspect, however, that the answer you'll get back is "not possible".
That said, many mail clients do support open of "mailto" urls which might be the best you can expect to be able to do.

Related

Standarts for email source code

I am looking for standarts for email source code, just to know how to generate it using php.
My specific problem is with multipart/mixed email.
The email's subject is in cyrilic and when I am sending email it arives without errors, but subject of email can't be read. There is some problem with encoding.
Here is my email header:
From: no-reply#sample.eu\n
Reply-To: no-reply#sample.eu\n
Cc:\n
Bcc:\n
X-Priority: 1 (Highest)\n
X-Mailer: PHP/5.3.29\n
MIME-Version: 1.0\n
Content-Type: multipart/mixed;\n
boundary="==Multipart_Boundary_x3865d75cb66632b12851874c2aafd492x"\n
Please help!
The email standard is pretty large, but you should be able to work through the broad picture in a few days. The wikipedia page for email has links to all the RFC standards for the message format. It also has a broad overview of the format.
The standard for the main format is defined here. Mime/multimedia attachments are covered here and here.
IMHO, I would try to find a library to deal with this sort of stuff. It's easy to make mistakes when you are formatting this on your own. Here is one in PEAR that seems to do what you need.
Or, instead of trying to figure out how to do this in php, try to use a language with better unicode support like Python3 or Perl5 that actually does this for you automatically. You'll waste a lot less time.

MIME Emails - PDF and Content-ID

We are sending Emails using The MIME-Format.
(Underlying language is Java, using MultiPartEmail).
It has been reported by customers that their system reads the .pdf-Attachment of our emails twice.
The reason for this is, apparently, the lack of a Content-ID for the attachment.
I'm trying to fix this but found really vague information about the content-ID. Reading the standard i figured it is just supposed to be some unique ID in the form of <ID#domain>.
So i added this into our email generation, so that the "slot" which references the .pdf-attachment looks something like this:
------=_Part_0_12345667890
Content-Type: application/pdf;
name=theName.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=theName.pdf
Content-ID: <1431939868331#domain>
Is that all there is about it? The number is current time in milliseconds.
I'm unclear about the domain. Is it critical that this domain is exactly the right one?
And how can i understand this Content-ID attribute? Is it simply what i think it is: an ID so that attachments can be uniquly referenced by some email-systems or is there more to it? Why is the domain important?
Edit: I don't know if its related, but it seems the .pdf-Attachment doesnt show in the iPhone Mail software. I can't think of any other reason it would not show, as .pdf is surely supported and the files are also quite small. (The icon of an attachment shows in the overview-list but the attachment is nowhere referenced in the opened email)
To answer my own question:
Yes, it does the trick for many email services. There just has to be some kind of ID for the elements contained in MIME and then they are rendered and read correctly.

Coldfusion 9 - respool mail

I had a bunch of mail to be sent out that was not. I realized that my mail settings in Coldfusion Administrator were incorrect and have since corrected them. I tested the new settings with new mail and they work. I am now trying to re-send out the messages in the spool, but they go right back in the undelivered mail spool. I'm assuming that they are still using the old mail settings. Is there any way to force them to send out using the new current settings?
You'll need to edit the individual spool files, as they most likely have the mail server information in the file itself. If you open a few of the files in your badmail directory, you should be able to locate the server information and adjust accordingly.
If you can do a bulk find/replace on the files, it should make short work of it.

Does read/unread information exist in Thunderbird's .msf file?

I ran gmail backup, which marked all my gmail messages as read. Ugh. I actually use that read/unread information. I had just installed Thunderbird, and it shows hundreds of messages in "All Mail" that are unread. Only it had only downloaded the headers, not the messages. So something in Thunderbird knows they are unread, but I'm not sure exactly what.
I read that there are two files for any mail folder, an mbox-format file and a .msf file. The mbox format file for "All Mail" does not have all the messages. However, the .msf file is pretty big, and I wonder if it has all the read/unread info.
If it does, I would consider extracting it, and going back and reapplying it programmatically (say, using gmail4j).
The msf file is using Mork format so reading it is pretty complicated. Fortunately, you don't have to: the mails in the mbox file have a special X-Mozilla-Status header. It's a hexadecimal value combining a number of flags. The lowest bit in this header (0x0001) is only set for messages that are read - if it isn't there then the message is unread.
If you want to read only Header and the Summary part of your Emails, then you can read it from your .msf file of your Mozilla Thunderbird, Since The .msf file is just a index file of Mozilla Thunderbird. So you cannot read all the information of your Emails from it. To read your Emails, you first need to find the location of your INBOX File which doesn't have an extension.
you can find its location from here in your Thunderbird Email client:
C:\Users\admin\AppData\Roaming\Thunderbird\Profiles\wb09b73f.default\ImapMail\imap.googlemail.com
Then, copy it and paste it to other location of your system and rename it to INBOX.mbox and then you can easily import it from your Mozilla Thunderbird and can Easily read your Emails after importing it on your Thunderbird.

How to serve .RTFs

I support a web-application that displays reports from a database. Occassionally, a report will contain an attachment (which is typically an image/document which is stored in the database as well).
We serve the attachment via a dynamic .htm resource which streams the attachment from the database, and populates the content-type based on what type of attachment it is (we support PDFs, RTFs, and various image formats)
For RTFs we've come across a problem. It seems a lot of Windows users don't defaultly have an assocation for the 'application/rtf' content-type (they do have an association for the *.rtf file extention). As a result, clicking on the link to the attachment doesn't do anything in Internet Explorer 6.
Returning 'application/msword' as the content-type seems to make the RTF viewable when clicking on the link, but only for people who have MS Office installed (some of the users won't have this installed, and will use alternate RTF readers, like OpenOffice).
This application is accessed publicly, so we don't have control of the user's machine settings.
Has anybody here solved this before? And how? Thanks!
Use application/octet-stream content-type to force download. Once it's downloaded, it should be viewable in whatever is registered to handle .rtf files.
In addition to the Content-Type header, you also need to add the following:
Content-Disposition: attachment; filename=my-document.rtf
Wordpad (which is on pretty much every Windows machine) can view RTF files. Is there an 'application/wordpad' content-type?
Alternatively, given the rarety of RTF files, your best solution might be to use a server-side component to open the RTF file, convert it to some other format (like PDF or straight HTML), and serve that to the requesting client. I don't know what language/platform you're using on the server side, so I don't know what to tell you to use for this.