send email using JavaScript

send email using JavaScript

I am going to share the code sample for send email using JavaScript in MVC 5

Today's, I have a requirement to send the error report by default email in all browsers using JavaScript.


In the 1st step, Write the JavaScript code sample.

 $('.div_confimpopup').find('.btn_SendReport').click(function () {

//Need to send the error detail to dotnetsql.in support team with error details.
   var mesgDetails = 'mailto:support@dotnetsql.in?subject=' + 'UserName : ' + username
            + '  ||  SubscriptionId : ' +subscriptionId
    + '&body=' + 'UserName : ' + username
                   + ',  SubscriptionId : ' + subscriptionId
                   + ',  RequestURL : ' + requestURL
                   + ',  Error Message : ' + internalErrorMsg;

   window.location.href= mesgDetails;  return;
});  


Notes: After click on Send Report open to default email(Outlook) per-populated  To: support@dotnetsql.in 

Subject : UserName : anil.singh@dotnetsql.in || SubscriptionId : sub001

Body : UserName : anil.singh@dotnetsql.in, SubscriptionId : sub001,
          RequestURL : 'http://www.code-sample.com/2013/08/send-email-using-javascript.html'
          Error Message : ''value' is null or not an object'



ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

send email using JavaScript send email using JavaScript Reviewed by Unknown on 9:00 AM Rating: (5)
www.code-sample.com/. Powered by Blogger.
^