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:[email protected]?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: [email protected] 

Subject : UserName : [email protected] || SubscriptionId : sub001

Body : UserName : [email protected]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 Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.
^