{"id":1259,"date":"2014-04-29T09:47:05","date_gmt":"2014-04-29T13:47:05","guid":{"rendered":"http:\/\/andrewpallant.ca\/wordpress\/?p=1259"},"modified":"2014-06-27T15:55:41","modified_gmt":"2014-06-27T19:55:41","slug":"tricking-classic-asp-json-mandrill-experience","status":"publish","type":"post","link":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/","title":{"rendered":"Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience"},"content":{"rendered":"<p>Using JSON with Classic ASP can be a tricky thing, but the developer of <a title=\"ASPJSON\" href=\"http:\/\/www.aspjson.com\/\" target=\"_blank\">ASPJSON<\/a>\u00a0has made it very easy. \u00a0This library ( or include ) has made my life so much easier, but the instructions to get me started was somewhat raw and difficult for me to follow.<\/p>\n<p>Since my original posting about\u00a0\u00a0<a title=\"Tricking Out Classic ASP with JSON\" href=\"http:\/\/andrewpallant.ca\/wordpress\/tricking-out-classic-asp-with-json\/\" target=\"_blank\">Tricking Out Classic ASP with JSON<\/a>, I have had several people ask for the solution to <a title=\"Visit SendGrid for more info\" href=\"http:\/\/www.sendgrid.com\" rel=\u201dnofollow\u201d target=\"_blank\">SendGrid <\/a>and <a title=\"Visit Mandrill for more information\" href=\"http:\/\/www.mandrill.com\" rel=\u201dnofollow\u201d target=\"_blank\">Mandrill<\/a>. \u00a0Both systems are very different, but the principals are similar. \u00a0I found Mandrill the easiest to implement.<\/p>\n<p>The following code is the magic to it all, but this example is specific to Mandrill.<\/p>\n<pre style=\"font-family: arial; font-size: 12px; border: 1px dashed #CCCCCC; width: 99%; height: auto; overflow: auto; background: #f0f0f0; ;background-image: url('http:\/\/2.bp.blogspot.com\/_z5ltvMQPaa8\/SjJXr_U2YBI\/AAAAAAAAAAM\/46OqEP32CJ8\/s320\/codebg.gif'); padding: 0px; color: #000000; text-align: left; line-height: 20px;\"><code style=\"color: #000000; word-wrap: normal;\">   jsonstring = \"\"  \r\n\r\n   If Request.TotalBytes &gt; 0 Then   \r\n     Dim lngBytesCount   \r\n     lngBytesCount = Request.TotalBytes   \r\n     jsonstring = BytesToStr(Request.BinaryRead(lngBytesCount))   \r\n   End If   \r\n\r\n   Set oJSON = New aspJSON  \r\n   'Load JSON string  \r\n   jsonstring = replace(jsonstring, \"mandrill_events=\",\"\")  \r\n   oJSON.loadJSON(URLDecode(jsonstring))  \r\n\r\n ' Loop Through Records  \r\n for i = 0 to oJSON.data.count -1  \r\n   str = oJSON.data(i).item(\"event\")  \r\n   straddress = oJSON.data(i).item(\"msg\").item(\"email\")  \r\n next  \r\n<\/code><\/pre>\n<p>You can download the full code sample from: \u00a0<a title=\"Download Mandrill Sample\" href=\"http:\/\/www.unlatched.com\/sample\/Mandrill%20with%20Classic%20ASP\/mandrill%20aspjson%20testing.zip\" target=\"_blank\">http:\/\/www.unlatched.com\/sample\/Mandrill%20with%20Classic%20ASP\/mandrill%20aspjson%20testing.zip<\/a><\/p>\n<p>I did include the ASPJSON include file so that you would get the complete solution; but you should ensure you have the latest once you have my example working. \u00a0Goto\u00a0<a title=\"ASPJSON\" href=\"http:\/\/www.aspjson.com\/\" target=\"_blank\">ASPJSON<\/a>\u00a0to get the latest library.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using JSON with Classic ASP can be a tricky thing, but the developer of ASPJSON\u00a0has made it very easy. \u00a0This library ( or include ) has made my life so much easier, but the instructions to get me started was somewhat raw and difficult for me to follow. Since my original posting about\u00a0\u00a0Tricking Out Classic &hellip; <a href=\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[146,151,96],"tags":[167,257,200,201,202],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper<\/title>\r\n<meta name=\"description\" content=\"Tricking Out Classic ASP With JSON - The Mandrill Experience\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper\" \/>\r\n<meta property=\"og:description\" content=\"Tricking Out Classic ASP With JSON - The Mandrill Experience\" \/>\r\n<meta property=\"og:url\" content=\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\" \/>\r\n<meta property=\"og:site_name\" content=\"LDNDeveloper\" \/>\r\n<meta property=\"article:published_time\" content=\"2014-04-29T13:47:05+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2014-06-27T19:55:41+00:00\" \/>\r\n<meta name=\"author\" content=\"ldnDeveloper\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:creator\" content=\"@LdnDeveloper\" \/>\r\n<meta name=\"twitter:site\" content=\"@LdnDeveloper\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ldnDeveloper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\"},\"author\":{\"name\":\"ldnDeveloper\",\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84\"},\"headline\":\"Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience\",\"datePublished\":\"2014-04-29T13:47:05+00:00\",\"dateModified\":\"2014-06-27T19:55:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\"},\"wordCount\":171,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84\"},\"keywords\":[\"Classic ASP\",\"JSON\",\"Mandrill\",\"SendGrid\",\"vbScript\"],\"articleSection\":[\"ASP\",\"JSON\",\"Web\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\",\"url\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\",\"name\":\"Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper\",\"isPartOf\":{\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#website\"},\"datePublished\":\"2014-04-29T13:47:05+00:00\",\"dateModified\":\"2014-06-27T19:55:41+00:00\",\"description\":\"Tricking Out Classic ASP With JSON - The Mandrill Experience\",\"breadcrumb\":{\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/andrewpallant.ca\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#website\",\"url\":\"https:\/\/andrewpallant.ca\/wordpress\/\",\"name\":\"LDNDeveloper\",\"description\":\"Learning, Growing and Sharing.\",\"publisher\":{\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/andrewpallant.ca\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84\",\"name\":\"ldnDeveloper\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/andrewpallant.ca\/wordpress\/wp-content\/uploads\/2017\/05\/cropped-AAEAAQAAAAAAAAXQAAAAJDQxMGRlMzFjLWM4ODctNDk1NC05M2EyLWE1NDNhNTRiZjVlYw-2.jpg\",\"contentUrl\":\"https:\/\/andrewpallant.ca\/wordpress\/wp-content\/uploads\/2017\/05\/cropped-AAEAAQAAAAAAAAXQAAAAJDQxMGRlMzFjLWM4ODctNDk1NC05M2EyLWE1NDNhNTRiZjVlYw-2.jpg\",\"width\":512,\"height\":512,\"caption\":\"ldnDeveloper\"},\"logo\":{\"@id\":\"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/image\/\"},\"description\":\"Andrew Pallant (@LdnDeveloper) has been a web, database and desktop developer for over 16 years. Andrew has worked on projects that ranged from factory automation to writing business applications. Most recently he has been heavily involved in various forms for ecommerce projects. Over the years Andrew has worn many hats: Project Manager, IT Manager, Lead Developer, Supervisor of Developers and many more - See more at: http:\/\/www.unlatched.com\/#sthash.8DiTkpKy.dpuf\",\"sameAs\":[\"http:\/\/www.andrewpallant.ca\",\"https:\/\/x.com\/LdnDeveloper\"],\"url\":\"http:\/\/andrewpallant.ca\/wordpress\/author\/ldndeveloper\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper","description":"Tricking Out Classic ASP With JSON - The Mandrill Experience","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/","og_locale":"en_US","og_type":"article","og_title":"Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper","og_description":"Tricking Out Classic ASP With JSON - The Mandrill Experience","og_url":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/","og_site_name":"LDNDeveloper","article_published_time":"2014-04-29T13:47:05+00:00","article_modified_time":"2014-06-27T19:55:41+00:00","author":"ldnDeveloper","twitter_card":"summary_large_image","twitter_creator":"@LdnDeveloper","twitter_site":"@LdnDeveloper","twitter_misc":{"Written by":"ldnDeveloper","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#article","isPartOf":{"@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/"},"author":{"name":"ldnDeveloper","@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84"},"headline":"Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience","datePublished":"2014-04-29T13:47:05+00:00","dateModified":"2014-06-27T19:55:41+00:00","mainEntityOfPage":{"@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/"},"wordCount":171,"commentCount":10,"publisher":{"@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84"},"keywords":["Classic ASP","JSON","Mandrill","SendGrid","vbScript"],"articleSection":["ASP","JSON","Web"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/","url":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/","name":"Tricking Out Classic ASP With JSON - The Mandrill Experience - LDNDeveloper","isPartOf":{"@id":"https:\/\/andrewpallant.ca\/wordpress\/#website"},"datePublished":"2014-04-29T13:47:05+00:00","dateModified":"2014-06-27T19:55:41+00:00","description":"Tricking Out Classic ASP With JSON - The Mandrill Experience","breadcrumb":{"@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/andrewpallant.ca\/wordpress\/tricking-classic-asp-json-mandrill-experience\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/andrewpallant.ca\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Tricking Out Classic ASP With JSON &#8211; The Mandrill Experience"}]},{"@type":"WebSite","@id":"https:\/\/andrewpallant.ca\/wordpress\/#website","url":"https:\/\/andrewpallant.ca\/wordpress\/","name":"LDNDeveloper","description":"Learning, Growing and Sharing.","publisher":{"@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/andrewpallant.ca\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/f6f5bb1ac3e0c5a54a8b5ce35fd67b84","name":"ldnDeveloper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/andrewpallant.ca\/wordpress\/wp-content\/uploads\/2017\/05\/cropped-AAEAAQAAAAAAAAXQAAAAJDQxMGRlMzFjLWM4ODctNDk1NC05M2EyLWE1NDNhNTRiZjVlYw-2.jpg","contentUrl":"https:\/\/andrewpallant.ca\/wordpress\/wp-content\/uploads\/2017\/05\/cropped-AAEAAQAAAAAAAAXQAAAAJDQxMGRlMzFjLWM4ODctNDk1NC05M2EyLWE1NDNhNTRiZjVlYw-2.jpg","width":512,"height":512,"caption":"ldnDeveloper"},"logo":{"@id":"https:\/\/andrewpallant.ca\/wordpress\/#\/schema\/person\/image\/"},"description":"Andrew Pallant (@LdnDeveloper) has been a web, database and desktop developer for over 16 years. Andrew has worked on projects that ranged from factory automation to writing business applications. Most recently he has been heavily involved in various forms for ecommerce projects. Over the years Andrew has worn many hats: Project Manager, IT Manager, Lead Developer, Supervisor of Developers and many more - See more at: http:\/\/www.unlatched.com\/#sthash.8DiTkpKy.dpuf","sameAs":["http:\/\/www.andrewpallant.ca","https:\/\/x.com\/LdnDeveloper"],"url":"http:\/\/andrewpallant.ca\/wordpress\/author\/ldndeveloper\/"}]}},"_links":{"self":[{"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1259"}],"collection":[{"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/comments?post=1259"}],"version-history":[{"count":5,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1259\/revisions"}],"predecessor-version":[{"id":1313,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/posts\/1259\/revisions\/1313"}],"wp:attachment":[{"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/media?parent=1259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/categories?post=1259"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/andrewpallant.ca\/wordpress\/wp-json\/wp\/v2\/tags?post=1259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}