To send an e-mail you'll need a server-side process that actually does the sending. I would suggest using buttons.exportData() to get the data to send, then use Ajax to your script that will actually send the data and submit the data to it as a parameter.
Not of the server-side script. That is outside of the scope of the free support I can give. I don't even know what server-side environment you are working with.
In terms of the client-side:
var table = $('#myTable').DataTable({
buttons: [{
text: 'Export data',
action: function (e, dt) {
var exportData = dt.buttons.exportData();
// Use $.ajax or `fetch` to send `exportData` to the server to e-mail
// ...
}
}]
});
Answers
You'll need to elaborate a little please. Do you mean a link to the page, the content from the table, a screenshot or something else?
Allan
content of datatable in to an email as datatable
To send an e-mail you'll need a server-side process that actually does the sending. I would suggest using
buttons.exportData()
to get the data to send, then use Ajax to your script that will actually send the data and submit the data to it as a parameter.Allan
can you give me an example please
Not of the server-side script. That is outside of the scope of the free support I can give. I don't even know what server-side environment you are working with.
In terms of the client-side:
Allan