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

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Buy Books Online at Best Prices

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.