Page 1 of 1

how to open eml file using outlook

Posted: Wed May 13, 2009 1:32 am
by yerupalleyskumar
I have developed a web application in which user will click on a link to view the contents.
My php code will inturn create an eml file and the contents are opend in a browser.
what i want is whenever user clicks on the link the eml file should open in a user configured email clients like outlook express or microsoft outlook.
can any one help in doing this.
Thanks in advance

Re: how to open eml file using outlook

Posted: Wed May 13, 2009 2:25 am
by Griven
As a web developer, this isn't really something that you can control. What program opens up what type of file is a client-side configuration, and is set within the user's operating system.

Is this an application you're developing for a company to use on their intranet? If not, I'd suggest rethinking your strategy because not all mail clients will open EML files. Some people (like myself) don't even have email clients configured on their computers--we prefer to use webmail services like Gmail or Yahoo.

If this is an application being deployed outside a company's intranet (where all the computers will have the same mail client configured), then I think you'd be better off printing the contents of the said file to the page, rather than any sort of file.

Re: how to open eml file using outlook

Posted: Wed May 13, 2009 2:46 am
by yerupalleyskumar
thank you for your quick responce. But as per my application i am creating my own eml file and right now i am giving a link in the browser to download the file and open with the email client. I dont want user to save the file to view the contents. As soon as he clicks on the link the eml file has to open in outlook express if the client is configured in the users computer if it is not i will through an error saying that it can be viewed with mail clients.

Re: how to open eml file using outlook

Posted: Wed May 13, 2009 3:33 am
by Griven
Since PHP is a server-side code, it's not going to be able to detect whether or not a person has a particular program installed and configured on their computer. You may be able to do it with some client-side code (Javascript maybe--I could be wrong), but it's really best that as web designers, we leave user's computers alone. That's their domain, not ours.

I stand by my previous recommendation of not going the EML file route.

Perhaps if you told me a bit more about your application, I could offer a bit more insight into alternatives. What does it do for the user, what are you trying to accomplish, what problems are you trying to solve with it, etc, etc?

Re: how to open eml file using outlook

Posted: Wed May 13, 2009 3:53 am
by yerupalleyskumar
My requirement is i am populating set of eml files in a grid. these eml files may contain different attachments.
right now whenever user cliks on any eml file in the grid i am opening a new window using javascript and showing the contents of the mail in the browser.
Since browser has its own limitation i am not able to view the attachments. So whenever user clicks on one of the eml file in the grid it has to open as complete mail.
it is happening when i save the file to my computer and i can see the entire mail with attachements.But it has to happen without saving. I hope it makes sense.

Re: how to open eml file using outlook

Posted: Wed May 13, 2009 3:59 am
by Griven
Aha, gotcha.

Unfortunately, you're not going to get rid of the option to save. The "Open, Save" dialogue box is built directly into the user's browser, so you've got no control over that.

A workaround would be to split the EML file from its attachment, and store them separately in a database. Then, you can display the text content of the EML file and a link to any attachments along with it.

Re: how to open eml file using outlook

Posted: Thu May 14, 2009 11:46 pm
by yerupalleyskumar
The topic is going in a different way. What i want is i want to open my email client in existing windows email client.
My requirement is very specific and i am not looking for an alternative solution. Please let me know if anybody can answer my requoirement.

thanks