大家好,我在Visual Studio中使用Cordova,我想发送类似于phpmailer的电子邮件。但是我想用Cordova做到这一点,我尝试了很多方法来做,甚至找到了一个名为
的插件cordova-smtp-client我安装了它,当我尝试在android上运行应用程序时,它给了我一个错误
js代码
document.getElementById("send").addEventListener("click", function () {
alert("yes we did it ")
var mailSettings = {
emailFrom: "emailFrom@domain.com",
emailTo: "emailTo@domain.com",
smtp: "smtp-mail.domain.com",
smtpUserName: "authuser@domain.com",
smtpPassword: "password",
attachments: ["attchament1", "attchament2"],
subject: "email subject",
textBody: "write something within the boddy of the email"
};
var success = function (message) {
alert(message);
}
var failure = function (message) {
alert("Error sending the email");
}
smtpClient.sendMail(mailSettings, success, failure);
});
错误图片
请问是否还有其他方法可以在Visual Studio中使用Cordova发送安全的电子邮件,请与我分享。谢谢