Broken MapiContact.save() method (VCard converting)

Hello,

right now we´re trying to generate .vcf Files from MapiContact s (com.aspose.email.MapiContact).
However the save() method seems to be bugged. Depending on which attributes you set
a broken or a incorrected encoded file will be generated.

If you execute the [example Code](http://www.aspose.com/docs/display/emailjava/Create+Outlook+Contact) only a broken file will be generated which can not be opened by any email client.

Even a further example from here, which I extendend with some attributes, is not generating a valid .vcf File.
If you try to import the .vcf in Thunderbird there is only a emtpy contact.
In Apple Contacts the file will not be encoded correct as you can see here:
[IMAGE](http://abload.de/image.php?img=bildschirmfoto2016-06easbv.png)

If you don´t set some attributes at the PhysicalAddresses (I tried some combinations like not setting PostalCode and Country for the homeAddress etc.) a unreadable or a completly broken file will be generated as you can see here:
[IMAGE](http://abload.de/image.php?img=bildschirmfoto2016-069euv2.png)

Example-Code: http://pastebin.com/iQQsXc4R

If you open the file with a text-editor some attributes like address or notes are not been converted and will be lost.

I tried version 6.1.0 and 6.6.0 with the same results.

Hi Nigel,

Thank you for contacting Aspose support team.

  1. I have executed [example Code](http://www.aspose.com/docs/display/emailjava/Create+Outlook+Contact) and opened the output vcf file using Outlook 2016 as shown in OutlookContact.png.
  2. I also tried code [here](http://www.aspose.com/docs/display/emailjava/Creating,+Saving+and+Reading+Outlook+Contacts) , generated MSG file and opened output file in Outlook 2016 as shown in image contact.png.
  3. I also executed your code given [here](http://pastebin.com/iQQsXc4R) and opened the output VCF file in Outlook 2016 as shown in userCode.png.

I am afraid that I could not re-produce the issue where broken contacts are generated which could not be opened in Outlook. Could you please explain in more detail what do you mean by broken contacts and provide us steps to re-produce the issue? It will help us to observe the problem and provide assistance accordingly.

Thank you for your reply.

I created a new minimal maven example just with Aspose.Email (1.6.1) and Junit to test if the same behavior occurs without any other dependency.
http://pastebin.com/S9a48Jic

The result is the same. If you want to take a look at the two outputs files they
are attached in a .zip.

Now I tried to open the two Vcards with Apple Address Book, Thunderbird, Google Mail and
Outlook with the following results:
Apple Address Book
contact1 is not a valid VCard and I can not import it.
contact2 is (as I call it) “broken” but importable as you can see in the first attached image.

Thunderbird
Imports both of the contacts but they are just empty, no data inside.

Outlook
Both contacts were imported successful as seen in your images.

Google Mail
contact1 is missing the Address fields (second attached Image).
contact2 is imported successful as far as I can see.

Now If I export contact1 and contact2 back from Google Mail to .vcf files
it is possible to import them to Apple Address Book and Thunderbird.
Apple Address Book imports the contacts(1+2) correct as you can see in the attached picture 3.
Pic 3 shows the difference between the output of Asposes contact2.vcf and the re-exported contact2.vcf from Google Mail.

On the otherside Thunderbird imports both but contact1 is missing all the telephone numbers.
contact2 has a merged address field as you can see in attached picture number 4.

It seems like some of the Email Clients have problems with the Address field which Aspose generates. Is there a way to configure the VCard generation?

Hi Nigel,


Thank you for providing more details.

This issue is reproduced and logged under Id: EMAILJAVA-34178 for further investigation by the product team. You will be automatically notified once any update is received in this regard.