Fetch Excel from SharePoint library and send email from any excel cell

Shiv Sharma 1 Reputation point
2021-01-13T09:03:00.763+00:00

Having a excel in below format :
Cell1st contains user name of the user ..and another 2nd cell contains login user durations.

User Name Duration
shiv.sharma, Duration: 5h:29m:31s
shiv.sharma, Duration: 0h:42m:32s
shiv.sharma, Duration: 5h:37m:46s
Amit.singh, Duration: 0h:47m:30s
rahul.sharma, Duration: 5h:17m:10s
rahul.sharma, Duration: 1h:13m:25s
Anurag.mishra, Duration: 1h:16m:02s
Anurag.mishra, Duration: 2h:14m:41s
Anurag.mishra, Duration: 3h:04m:19s
Deepak.chaudhary, Duration: 6h:19m:49s
kailash.k, Duration: 0h:59m:30s
Shri.KR, Duration: 7h:14m:20s

We have to send mail to users which are in cell 1st with body contains cell 2nd i.e duration of that user.

information should be send in a table

like shiv.sharma have multiple entries then all the entries should sent in one table of that user
Note Excel will be present from SharePoint library. Excel will be fetched of today's date.

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,374 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,012 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2021-01-14T08:10:31.533+00:00

    Hi @Shiv Sharma ,

    This requirement need to use SQL DataTable to achieve instead of Excel .

    As in Excel, it's hard to build a html datatable with query result and then send email.

    With SQL Datatable, it will easy to query result and build the html table dynamaically.

    Here are some demos to send email with data query html table from SQL Server for your reference:

    Sending HTML tables in mail from SQL Server

    Sending table form HTML emails from a SQL Server database engine

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.