简体   繁体   English

使用Cordova的Mailto链接在iOS 5中不起作用

[英]Mailto link not working in ios 5 using cordova

I have developed a mobile application using cordova 3.1. 我使用Cordova 3.1开发了一个移动应用程序。 In android and IOS 7 mailto link is perfectly working. 在android和iOS 7中,mailto链接可以正常工作。 But in IOS 5 it is not working after i upgraded cordova form 3.0 to 3.1. 但是在IOS 5中,在我将cordova形式3.0升级到3.1之后,它不起作用。

<a href="mailto:some@example.com">Example</a>

It is showing 它显示

Failed to load webpage with error: The URL can't be shown. 无法加载网页,并显示以下错误:无法显示网址。 What am i missing? 我想念什么?

Please try this on ios device 请在ios设备上尝试

 $('.anchortag').on("click", function (e) {

        var emailBody = "Body of Content";

        var subject = "This is test Subject";
        document.location.href = "mailto:customer@email.com?subject=" + subject + "&body=" + emailBody;

    });

OR 要么

    <div class="bottom-row">
       <a href="#" id="submitForm" title="Submit Answers">Submit Answers</a>
    </div>

    <form id="mailtoForm" action="mailto:test@gmail.com" target="_blank">
        <input type="hidden" name="Cc" value="">
        <input type="hidden" name="Bcc" value="">
        <input type="hidden" name="Subject" value="">
        <input type="hidden" name="Body" value="">
        <input type="submit" style="display:none">
    </form>



    $("#submitForm").on("click",function (e) {


       var emailBody = "Body of Content";

       var subject = "This is test Subject";

        $("#mailtoForm").find("input[name=Subject]").val(subject);
        $("#mailtoForm").find("input[name=Body]").val(emailBody);
        $("#mailtoForm").submit();


    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM