0

I am using Angular.js to create an Excel file but now I include also that file in my email from how to that possible. My js code:

$scope.email = function () {
            var blob = new Blob([document.getElementById('exportable').innerHTML], {
                type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;"

            });
            var i = (new Date().toJSON().slice(0, 10)) + "_" + "Report.xls";
            saveAs(blob, i);
        };

This is my HTML code:

<div class="container ">
<div class="row-fluid">

    <div class="col-md-12">
        <label class="control-label" for="Email_Id">Email Id</label>

    </div>
    <div class="col-md-6 spacer10">
        <input class="form-control" id="EmailId" name="EmailId" placeholder="Email-Id" type="text">
    </div>
    <div class="col-md-12">
        <label class="control-label" for="Subject">Subject</label>
    </div>
    <div class="col-md-6 spacer10">
        <input class="form-control" id="Subject" name="Subject" placeholder="Subject.." type="text"
    </div>
    <div class="col-md-12">
        <label class="control-label" for="Subject">Subject</label>
    </div>
    <div class="col-md-6 spacer10">

        <input class="form-control" id="Subject" name="Subject" type="file" valu="email()">
    </div>
    <div class="col-md-12">
        <label class="control-label" for="Message">Message</label>
    </div>
    <div class="col-md-6">
        <textarea class="form-control" cols="20" id="Message" name="Message" rows="5"></textarea>
    </div>
</div>

on this code type file, auto includes Excel file on creating time.

4
  • I do not know actually this will work. You have to add vbscript in excel and send email through it,. makeuseof.com/tag/send-emails-excel-vba Commented Jan 5, 2017 at 5:46
  • it work on excel file download time or i do not know about vb our company work on php Commented Jan 5, 2017 at 5:49
  • 1
    Then you have to write sending email code on server and make ajax call on it. If you want to excel data than you have to upload excel to server also or send data through ajax call Commented Jan 5, 2017 at 5:53
  • If you need to send email from Javascript take a look at EmailJS - it support file attachments as well (disclosure: I'm one of the founders). Commented Jan 5, 2017 at 13:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.