Where MAPI fields of mails are stored - email

I was trying to programatically achieve Communication thread tracking for Outlook. I have found this article on MSDN. And I fiddled with it a bit. It seems that it is possible to do it by tracking PR_CONVERSATION_INDEX by developing Outlook Add In.
However I would like to achieve the similar functionality in Java. Since I am quite new to MAPI development, I was not quite clear about where this PR_CONVERSATION_INDEX is stored in .msg file or somewhere in Exchange server that we access using MAPI.
I want to know if it is possible to intercept any incoming / outgoing message and obtain its PR_CONVERSATION_INDEX using Java. If PR_CONVERSATION_INDEX is stored in .msg file then I must be able to parse such file in Java and obtain the same.
If it is not stored in .msg file then I will like to know where it is stored and how can I access using Java.

I don't think Extended MAPI header files were ever translated to Java.
Use C++ (or Delphi).

Related

How do I export a gSuite user's email when I'm a delegate for their account

I'm trying to find a way to export the emails of a current employee without them knowing. I'm currently a delegate on the account and am using GAM. Any ideas?
If you are superadmin then you should look into either Google Vault which is the immutable record of emails see doc or you should use Got Your Back here written by Jay0lee who wrote GAM. GYB exports to MBOX though so if you want to share the emails with someone who for whatever reason can't read MBOX then you will need an MBOX to PST converter of which there are many online. I have used the one from Systools effectively link. Or you can export by GYB and then import into a different gmail account which is quite useful for some types of investigation.
If you are merely a delegate then there is no easy way.

How do I set Outlook extended properties on an email in C#?

I have currently written code to send an email in C# using the usual SMTPClient and MailMessage objects.
My new requirement is that the email being sent should have "permissions" set as if the user was sending the email via Outloook and using the option from the ribbon toolbar. The permission to be set is the "Do Not Forward" option.
The option I wish to emulate when sending the email is accessed here;
Can anyone please supply some sample .Net code to achieve this or else provide me with a good code reference online?
Thanks in advance,
Brian.
First of all, I am unaware as to how one might be able to set IRM (Information Rights Management) permissions using only a standard SMTP message (MailMessage). IRM permissions, I believe, are completely Outlook/Exchange-centric, and lack any sort of representation in the SMTP standard.
The only way you're going to be able to enable that permission is through the Outlook Object Model via the Outlook Interop assemblies. IamStalker above me recommended Redemption, which, while 99% of the time is the correct answer for everything Outlook-related, is not the way to go for this particular problem. Because IRM (as far as I know) has no representation in MAPI, Redemption wouldn't be much help here; I don't believe I've ever seen an IRM-related property on Redemption's object model.
You'll most likely be interested in the Permission property exposed by the MailItem object type. It appears that in order to programmatically turn on the "Do Not Forward" option, you will want to set the value of that property to OlPermission.olDoNotForward.
There is another IRM-related property (PermissionTemplateGuid), but it appears that you can leave this as an empty string since you are using a built-in "permission".
I would assume then that all other IRM-related settings are provided to Outlook through the user's Outlook profile.
Good luck!
Hello Brian I have only one suggestion "Redemption"!
I have used it and it's awesome it's very easy to implement the owner Dima is very nice person
he helps alot.
PS: It's not free but worth every penny.

Programming to Read and Send email

I would like to create a program that does the following:
1. Monitor all emails received at an address that I own, e.g. subscribe#mydomain.com
2. Read the From and Cc fields and insert those email addresses to my database
3. Parse the body of the email to find a certain text, such as a 6-digit registration code (assume I already have the logic to do the parsing)
4. Reply the emails from a template that includes the registration code and some other data retrieved from my database
To make my job easier, I would like to leverage any relevant services out there (maybe SendGrid, apinbox.com, etc.). Ideally all the servers are hosted somewhere in the cloud.
My question: Can you recommend the best way to do the above? You can consider me a total newbie in developing such programs, so please be gentle :-)
I don't know anything about the services you mention but It's fairly easy to write an app to do basic emailing in VB.Net. The built in SmtpClient class makes it easy to send emails, and there's plenty of projects on codeproject.com that shows how to read emails (just search there for POP3). The POP3 protocol isn't very difficult to implement, but it can be a little bit more difficult to handle MIME encoded content, but as I said, the projects at code project should show you that.
However, reading your question more carefully it sounds like you just want to have some automated way of sending out registration codes. If so, it might be worth to check if there isn't already services that'll do that for you. I'd suggest looking into that at some forum for Shareware Developers. One group I've heard of is the Association of Software Professionals, they might have some forum or advice about that.
If you are interested in a hosted service to handle the email parsing and conversion to HTTP POST I would recommend looking at a few like: http://mailhooks.com (free) http://mailnuggets.com (not free, but new and cheap). If you consider yourself a programming newbie, I would consider posting to a simple PHP script to test it out, like this:
<?php
// put the code below in a file at yourwebsite.com/test.php
// and POST your email to it as a test.
$postArr = print_r($_POST,1);
$log = "postLog.txt";
$fh = fopen($log, 'w') or die("can't open file");
fwrite($fh, $postArr);
fclose($fh);
?>
This will log the posted contents to a file called postLog.txt. Some of the mail processing services mentioned above may also have sample code to help out.

Looking for an email/report templating engine with database backend - for end-users

We have a number of customers that we have to send monthly invoices too. Right now, I'm managing a codebase that does SQL queries against our customer database and billing database and places that data into emails - and sends it.
I grow weary of maintaining this every time we want to include a new promotion or change our customer service phone numbers. So, I'm looking for a replacement to move more of this into the hands of those requesting the changes.
In my ideal world, I need :
A WYSIWYG (man, does anyone even say that anymore?) email editor that generates templates based upon the output from a Database Query.
The ability to drag and drop various fields from the database query into the email template.
Display of sample email results with the database query.
Web application, preferably not requiring IIS.
Involve as little code as possible for the end-user, but allow basic functionality (i.e. arrays/for loops)
Either comes with it's own email delivery engine, or writes output in a way that I can easily write a Python script to deliver the email.
Support for generic Database Connectors. (I need MSSQL and MySQL)
F/OSS
So ... can anyone suggest a project like this, or some tools that'd be useful for rolling my own?
(My current alternative idea is using something like ERB or Tenjin, having them write the code, but not having live-preview for the editor would suck...)
I think your looking for a reporting tool which is also capable of sending email. Sending a generared report in html or pdf shouldn't be to hard to do as well.
I've used JasperReports in the past for which I think it should fit your needs.
Another good solution is the pentaho reporting tool
You could easily write something on your own.. give them a basic edit control and allow them to use psuedo variables like {customername} {anothercustomerattribute} within the mail body.
On submit either send directly or save as template.
When the template is sent away the script automatically parses stuff like {customername} into the real customers name from the database.
Your own very very simple custom scriptlanguage :)
Everything else like loops and so on would be maintained on serverside. And if you want particular groups of customers to receive the letter, allow the enduser to select from selectboxes or whatever and do the rest on the serverside with pre-defined rules.

What to do with CSV after export on the iPhone?

One of the requested features for my apps is to have an export feature. Most of the time the data is table-like in nature. As an example, users might enter every day what types of food they ate that day, and how many portions of each food type. As the data is table-like, I figure the most useful for export would be into CSV format. Then it can be read in spreadsheet software.
I'm confident I can get the data into a CSV like format without too much trouble, and found this post would should help me: How to convert data to CSV or HTML format on iOS?
What I'm wondering about is what I can do with the file once it has been created? Can I attach it to an email? How else can I make it available to the user so that it has some use?
Alternatively, am I going about this the wrong way and would there be a better way to offer an export function?
I would suggest using MFMailComposeViewController and attaching your CSV file to it. This has the benefit of allowing the user to forward to the file to multiple recipients, customize the email body etc. You can also insert HTML into the email body, so if the data isn't too large you could simply present a table of the information within the email itself.
To send an attachment follow the instructions here.
Usually when an iPhone app needs exporting functionality you have the following options:
Attaching it to an email (as you mentioned)
Sending it to a server (with HTTP or any other TCP/IP based protocol)
Exposing it with a small WebServer you code inside your app (like the Video Camera APPs for 3G and older iPhones do)
Unfortunately, you can't use iTunes for sync your exported file. At least you can't with the current version of the SDK.
Instead of CSV, I would use XML. It can also be read with Excel (or any other spreadsheet), plus you won't have to deal with COMMA (or any other separator for that matter) escaping.