Created
September 26, 2025 15:27
-
-
Save aspose-com-gists/ead680c96df4e46d4edc49f7c55f4632 to your computer and use it in GitHub Desktop.
Convert Outlook VCF to HTML and HTML to VCF in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var msg = MapiContact.FromVCard("contact.vcf").GetUnderlyingMessage(); | |
var htmlSaveOptions = new HtmlSaveOptions | |
{ | |
HtmlFormatOptions = HtmlFormatOptions.RenderVCardInfo | HtmlFormatOptions.WriteHeader | |
}; | |
msg.Save("contact.html", htmlSaveOptions); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var content = File.ReadAllText("content.html"); | |
var contact = new MapiContact | |
{ | |
NameInfo = { DisplayName = "somebody" }, | |
ElectronicAddresses = { Email1 = { EmailAddress = "[email protected]" } } | |
}; | |
contact.SetBodyContent(content, BodyContentType.Html); | |
contact.Save("contact.vcf", ContactSaveFormat.VCard); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment