Sign in to follow this  
Followers 0
Juvigy

Outlook - How to determine mail language

7 posts in this topic

I have a PST which is an archive from an General Mailbox. Inside there are different types of mails in different languages:

Some are HTML other TEXT , some in English other in French and German. I would like to be able to programatically tell in which language is the mail. Any idea how this can be done?

PS. I am fairly familiar with the outlook UDFs and MSDN Outlook object reference.

Share this post


Link to post
Share on other sites



As I see it, not really a question related to AutoIT specifically but for programming in general. And a hard one too, as "language" is a soft parameter which is hard to analyze.

This page has some suggestions. One of them being detectlanguage.com - the API seems to be free to use.

For no API use, perhaps you have distinct words you can search for ?

Not much of a solution, just some general pointers. Hope they're helpful to you.


I am just a hobby programmer, and nothing great to publish right now.

Share this post


Link to post
Share on other sites

The problem is i will need 20 000 detections. The free version is only 5k per day.

Share this post


Link to post
Share on other sites

Give function _OL_MailHeaderget a try.

In the example I have run here I get

...

"Accept-Language: de-DE, de-AT, en-US"

"Content-language: de-DE"

...

for a mail written in german.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Doesnt work for most of my mails - If there is some english - for example in the signiture it says it is English and not Deutch.

Share this post


Link to post
Share on other sites

Looks like that is the only automated information Outlook provides. But how would you determine the language of a mixed mail?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I am thinking of getting the mail body only and checking 10% of the words against a dictionary or something.

I am still thinking about it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0