我使用cordova 3.1开发了一个移动应用程序。在android和IOS 7中,mailto链接非常有效。但在IOS 5中,我将cordova 3.0升级到3.1后无法正常工作。
<a href="mailto:some@example.com">Example</a>
显示
无法加载包含错误的网页:无法显示网址。我错过了什么?
答案 0 :(得分:0)
请在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();
});