{"id":26079,"date":"2015-09-02T11:10:06","date_gmt":"2015-09-02T05:40:06","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=26079"},"modified":"2016-01-19T13:33:22","modified_gmt":"2016-01-19T08:03:22","slug":"mailto-links-on-android-devices","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/mailto-links-on-android-devices\/","title":{"rendered":"mailto links on android devices"},"content":{"rendered":"<p>Recently we added a feature that uses the mailto link. While testing it was found that working fine on Desktops, iPhones, and iPad&#8217;s but not on android devices. To debug it quickly, we created a test page with just mailto link in it as shown below<\/p>\n<pre>&lt;a href=\"mailto:someone@example.com?Subject=Hello%20again\" target=\"_blank\"&gt;Send Mail&lt;\/a&gt;\r\n<\/pre>\n<p>and then tested this test page, and guess what it works with the android device!!!.<\/p>\n<p>So, this means that something is different or special in the actual (application\u2019s) HTML. After investigating further, we realized that the \u2018mailto\u2019 link is placed within a nested iFrame instead of the top level page.<\/p>\n<p><strong> This concludes that this case was not getting handled on Android when mailto is within an iFrame.<\/strong><\/p>\n<p>Then to quickly try again, we updated the target attribute of the anchor tag to value &#8220;_top&#8221;. Miraculously it worked!!!<\/p>\n<pre>&lt;a href=\"mailto:someone@example.com?Subject=Hello%20again\" target=\"_top\"&gt;Send Mail&lt;\/a&gt;\r\n<\/pre>\n<p>Hope this helps!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently we added a feature that uses the mailto link. While testing it was found that working fine on Desktops, iPhones, and iPad&#8217;s but not on android devices. To debug it quickly, we created a test page with just mailto link in it as shown below &lt;a href=&#8221;mailto:someone@example.com?Subject=Hello%20again&#8221; target=&#8221;_blank&#8221;&gt;Send Mail&lt;\/a&gt; and then tested this test [&hellip;]<\/p>\n","protected":false},"author":528,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":83},"categories":[518,1772],"tags":[4845,4842,2279,2277,2278],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/26079"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/528"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=26079"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/26079\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=26079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=26079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=26079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}