We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to upload an Excel file and extract emails from it?

Platform: ASP.NET MVC |
Control: Uploadbox
Tags: uploadbox


You can upload an excel file in UploadBox control and extract the specific column from that excel file.



You can upload an excel file in upload box control by specifying excel file extension is allowed to upload as illustrated in the following code example.







While uploading an excel file, you need to read the data from that excel, extract the specific column and add it to list as shown below code.




private List<MailData> ConvertData(string file)


             List<MailData> list = new List<MailData>();

             ExcelEngine excelEngine = new ExcelEngine();           

             IWorkbook workbook = excelEngine.Excel.Workbooks.Open(file);

             IWorksheet worksheet = workbook.Worksheets[0];

             for (int column = 1; column <= worksheet.UsedRange.LastColumn; column++)

                 if (worksheet.Range[1, column].Value.ToLower() == "mailid")

                     for (int row = 2; row <= worksheet.UsedRange.LastRow; row++)

                         list.Add(new MailData() { MailID = worksheet.Range[row, column].Value.ToString() });



             return list;




Once the uploading process is completed, “complete” client side event will be triggered in our uploadbox control. In that event, you can display the extracted columns which are read from the excel file in argument of complete event.









  function onSuccess(args) {

        if (args.responseText != "")


            $("#maildata").ejListBox({ dataSource: JSON.parse(args.responseText), fields: { text: "MailID" }, height: "200" });


            $("#header").html("E-Mail ID Lis:");





You can download the sample from the following location:

Sample:  Uploadbox Sample
Excel file:  SampleData Excel File


2X faster development

The ultimate ASP.NET MVC UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile