In one of my AngularJS web applications, I need to confirm a password by sending emails to a concerned person. How can I achieve this in AngularJS? I am a .NET guy and I am
I have achieved through web services Please refer the code snippet below
public bool EmailNotification()
{
using (var mail = new MailMessage(emailFrom, "test.test.com"))
{
string body = "Your message : [Ipaddress]/Views/ForgotPassword.html";
mail.Subject = "Forgot password";
mail.Body = body;
mail.IsBodyHtml = false;
var smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(emailFrom, emailPwd);
smtp.Port = 587;
smtp.Send(mail);
return true;
}
}
and ajax call as
$.ajax({
type: "POST",
url: "Service.asmx/EmailNotification",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data)
{
},
error: function (XHR, errStatus, errorThrown) {
var err = JSON.parse(XHR.responseText);
errorMessage = err.Message;
alert(errorMessage);
}
});