MyCardContact.Save(My.Application.Info.DirectoryPath + “\0.vcf”, ContactSaveFormat.WebDav)
the specified save format is not supported
Same error when using:
MyCardContact.Save(My.Application.Info.DirectoryPath + “\0.vcf”, ContactSaveFormat.Msg)
As seen in Outlook 2021, a cer is added to the contact, this .cer file is at least expected to be added as attachment when saving contact in any email format
I see it’s there is vcf:
KEY;X509;ENCODING=BASE64:
@australian.dev.nerds
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILNET-40961
You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Since VCardContact.ExplanatoryInfo.ProdId is read-only, when saving a contact as vcf, how to set it to be saved?
And what’s its difference with VCardContact.Mailer?
Is .Mailer equivalent to XMailer in Eml?
Happily VCardContact.Security.Key exists and works! But can’t add it as attachment using any of these 2 methods:
Email.Attachment.CreateAttachmentFromString(VCardContact.Security.Key, contentType, contentEncoding, mediaType)
don’t know what to enter for contentType, contentEncoding, mediaType
or also:
VCardContact.Security.SaveToPEM(MyMemoryStream)
MailMessage.AddAttachment(New Email.Attachment(MyMemoryStream, “smime.cer”))
And finally, the usual question, when any type of vcf files (different encodings) are expected to be loaded (.Load), shall we set the Encoding or not, if yes, UTF-8?
Thanks
Hello and thanks so much for your valuable help.
Unlike MapiContact.FromVCard, VCardContact.Load will not automatically add the contact photo as attachment to the target msg file when saved:
VCardContact.Save (MemoryStream ,ContactSaveFormat.Msg)
Please kindly share the code to add contact photo as attachment to the target msg?
VCardContact contact = VCardContact.Load(fileName);
MailMessage msg = new MailMessage();
string type = "image/jpeg";//can be figure out by contact.IdentificationInfo.Photo.PhotoType
ContentType ct = new ContentType(type);
ct.Name = "my photo";
msg.AddAttachment(new Attachment(new MemoryStream(contact.IdentificationInfo.Photo.Data), ct));
MemoryStream ms = new MemoryStream();
contact.Save(ms);
msg.AddAlternateView(new AlternateView(ms, new ContentType("text/vcard")));
msg.Subject = contact.IdentificationInfo.DisplayName;
Hello,
A big problem is that when we load a .vcf file to VCardContact, we have:
VCardContact.Security.Key
But when the same message is saved as .msg using Outlook, or parsed from Pst, and loaded via MapiContact.FromVCard, how can we get the attached public key?
Please kindly advise
MapiContact…Save(MyMemoryStream, ContactSaveFormat.VCard)
Dim MyCardContact As VCardContact = VCardContact.Load(MyMemoryStream)
MyCardContact.Security.Key…
However, MapiContact.Security for MapiContact is missing, possible to add it, like what we have in VCardContact?
@australian.dev.nerds
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILNET-40965,EMAILNET-40966
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The eml(emlx) and vcf formats are different, there are no conversion standards for them to convert, so we use the vcf addition as an alternative view.
It was fixed, fix will be available in 23.02 version.
This feature was added, it will be available in 23.02 version.
I could not find in documentation any corresponded MAPI property for Mailer , so it not make sense to add Mailer in MapiContact which is a set of MAPI properties.
In object model VCardVersion not present, but you can save in file or stream current contact with appropriate version by set VCardSaveOptions.Version
It was fixed, fix will be available in 23.02 version.
It was fixed, fix will be available in 23.02 version.
Note. The .cer file is not added as an attachment, instead it is stored in the PR_USER_X509_CERTIFICATE special MAPI property, as Outlook does.
It was fixed, fix will be available in 23.02 version.
Hi,
Of course should not be added as attachment, my bad, misunderstanding, but what if we save as mht with all parameters? There might be wise to have it as attachment…
Anyhow:
Dim MyMapiProperty As MapiProperty = MyContact.Properties(MapiPropertyTag.PR_USER_X509_CERTIFICATE)
If MyMapiProperty IsNot Nothing Then
MyMemoryStream = New MemoryStream(MyMapiProperty.Data, False)
Dim Myattach As New Email.Attachment(“smime.cer”, “application/x-x509-ca-cert”)
Myattach.ContentStream = MyMemoryStream
MyMailMessage.Attachments.Add(Myattach)
End If
is correct? seems not, it’s not adding a new attachment but trying to load one from my app’s path!
Since contacts are saved as Msg first, I’d be more happy if I can add that .cer directly to the MapiMessage:
Dim MyMapiProperty As MapiProperty = MyContact.Properties(MapiPropertyTag.PR_USER_X509_CERTIFICATE)
If MyMapiProperty IsNot Nothing Then
MyMapiMessage.Attachments.Add(“smime.cer”, MyMapiProperty.Data)
,
A file named smime.cer is added to the message with the size of 1 byte (just one single space inside)