{"id":2535,"date":"2012-03-03T14:18:25","date_gmt":"2012-03-03T12:18:25","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=2535"},"modified":"2013-06-25T23:25:06","modified_gmt":"2013-06-25T21:25:06","slug":"receive-vcard-business-card","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/receive-vcard-business-card","title":{"rendered":"Receive vCard business card"},"content":{"rendered":"<div class=\"well\">\nYou can also read how to: <\/p>\n<ul>\n<li><a href=\"\/blog\/send-vcard-business-card\">Send VCard business card<\/a><\/li>\n<li>Receive VCard business card<\/li>\n<\/ul>\n<\/div>\n<p><a href=\"\/mail\">Mail.dll .NET email component<\/a> makes receiving vCard business cards easy.<\/p>\n<p><em>IMail<\/em> object exposes <em>VCards<\/em> collection that contains all vCard business cards that were found while parsing an email.<\/p>\n<p>You can use both IMAP or POP3 protocol to <a href=\"\/blog\/receive-unseen-emails-using-imap\">download email from the server<\/a>.<\/p>\n<p>Here&#8217;s the simple sample showing how to process VCard business cards:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C#\r\n\r\nIMail email = new MailBuilder().CreateFromEml(client.GetMessageByUID(uid));\r\n\r\nforeach (VCard vCard in email.VCards)\r\n{\r\n\r\n    Console.WriteLine(&quot;first name: &quot; + vCard.Name.FirstName);\r\n    Console.WriteLine(&quot;last name: &quot; + vCard.Name.LastName);\r\n    Console.WriteLine(&quot;full name: &quot; + vCard.FullName);\r\n    \r\n    Console.WriteLine(&quot;email: &quot; + vCard.Email);\r\n    Console.WriteLine(&quot;work phone: &quot; + vCard.WorkPhone);\r\n    Console.WriteLine(&quot;home phone: &quot; + vCard.HomePhone);\r\n\r\n    if (vCard.WorkAddress != null)\r\n    {\r\n        Console.WriteLine(vCard.WorkAddress.PostOfficeBox);\r\n        Console.WriteLine(vCard.WorkAddress.ApartmentNumber);\r\n        Console.WriteLine(vCard.WorkAddress.Street);\r\n        Console.WriteLine(vCard.WorkAddress.City);\r\n        Console.WriteLine(vCard.WorkAddress.Region);\r\n        Console.WriteLine(vCard.WorkAddress.PostalCode);\r\n        Console.WriteLine(vCard.WorkAddress.Country);\r\n    }\r\n    if (vCard.HomeAddress != null)\r\n    {\r\n        \/\/...\r\n    }\r\n\r\n    foreach (VCardPhone phone in vCard.Phones)\r\n    {\r\n        Console.WriteLine(&quot;phone: &quot; + phone.Value);\r\n    }\r\n    foreach (VCardAddress address in vCard.Addresses)\r\n    {\r\n        Console.WriteLine(&quot;street: &quot; + address.Street);\r\n    }\r\n    foreach (VCardEmail mail in vCard.Emails)\r\n    {\r\n        Console.WriteLine(&quot;email: &quot; + mail.Value);\r\n    }\r\n}\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET\r\n\r\nDim email As IMail = New MailBuilder().CreateFromEml(client.GetMessageByUID(uid))\r\n\r\nFor Each vCard As VCard In email.VCards\r\n\r\n\tConsole.WriteLine(&quot;first name: &quot; + vCard.Name.FirstName)\r\n\tConsole.WriteLine(&quot;last name: &quot; + vCard.Name.LastName)\r\n\tConsole.WriteLine(&quot;full name: &quot; + vCard.FullName)\r\n\r\n\tConsole.WriteLine(&quot;email: &quot; + vCard.Email)\r\n\tConsole.WriteLine(&quot;work phone: &quot; + vCard.WorkPhone)\r\n\tConsole.WriteLine(&quot;home phone: &quot; + vCard.HomePhone)\r\n\r\n\tIf vCard.WorkAddress IsNot Nothing Then\r\n\t\tConsole.WriteLine(vCard.WorkAddress.PostOfficeBox)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.ApartmentNumber)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.Street)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.City)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.Region)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.PostalCode)\r\n\t\tConsole.WriteLine(vCard.WorkAddress.Country)\r\n\tEnd If\r\n\t\t\t'...\r\n\tIf vCard.HomeAddress IsNot Nothing Then\r\n\tEnd If\r\n\r\n\tFor Each phone As VCardPhone In vCard.Phones\r\n\t\tConsole.WriteLine(&quot;phone: &quot; + phone.Value)\r\n\tNext\r\n\tFor Each address As VCardAddress In vCard.Addresses\r\n\t\tConsole.WriteLine(&quot;street: &quot; + address.Street)\r\n\tNext\r\n\tFor Each mail As VCardEmail In vCard.Emails\r\n\t\tConsole.WriteLine(&quot;email: &quot; + mail.Value)\r\n\tNext\r\nNext\r\n<\/pre>\n<p>You can learn here how to <a href=\"\/blog\/send-vcard-business-card\">send email with VCard<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can also read how to: Send VCard business card Receive VCard business card Mail.dll .NET email component makes receiving vCard business cards easy. IMail object exposes VCards collection that contains all vCard business cards that were found while parsing an email. You can use both IMAP or POP3 protocol to download email from the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15,33,28,77,42,57,71],"class_list":["post-2535","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-imap","tag-imap-component","tag-pop3","tag-vb-net","tag-vcard"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/2535"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=2535"}],"version-history":[{"count":12,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/2535\/revisions"}],"predecessor-version":[{"id":4115,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/2535\/revisions\/4115"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=2535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=2535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=2535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}