I am new to using web services and I am trying to call a web service from an HTML page. However, I am encountering the following error message: "Hit error fn! [object Object]" and I am unable to send mail to the desired email address. Can you please help me troubleshoot this issue?
function test() {
var firstName = $('#txtName').val();
var lastName = $('#txtMessage').val();
var email = $('#txtEmail').val();
$.ajax({
url: "http://localhost/ZeroDebt/WsZeroDebtApp.asmx/SendEmailToClient",
data: {
_fromAddress: JSON.stringify(email),
_Subject: JSON.stringify("Zero Debt App Invitation Request"),
_body: JSON.stringify(firstName + ' ' + lastName),
clientName: JSON.stringify('Dr. Hanoi'),
clientEmail: JSON.stringify('<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5f3e3d3c1f27262571313a2b">[email protected]</a>')
},
dataType: "jsonp",
success: function(data) {
alert(data);
},
error: function(error) {
alert("Hit error fn!" + error);
}
});
}