Question: I am tried this sample :

```
public string TextFileProcess(string strReadtext, int nMinLine, int nMaxLine)
    {
        string strcount = string.Empty;
        List<string> lstResults = new List<string>();
        lstResults.Add(null);
        string strpattern= @"(?<=[\.!\?])+";
        string[] strSplitlines = Regex.Split(strReadtext, strpattern);
        string strresults=null;

        foreach(string  strsplittextsentence in strSplitlines)
        {
            string strsplittext= Regex.Replace(strsplittextsentence, @"[\s\r\n]+", " ");

            lstResults.Add((strsplittext));

            for(int i=1; i<lstResults.Count; i++)
            {
                strcount = lstResults[i] + lstResults[i - 1];
            }

            if(strsplittext.Length<=nMinLine)
            {
                    if(strcount.Length <= nMaxLine)
                    {
                        strresults += strcount;
                    }
                    else
                    {
                        if(nMinLine <= strsplittext.Length & nMaxLine >= strsplittext.Length)
                        {
                            strresults = strsplittext;
                            Console.WriteLine(strresults + Environment.NewLine);
                        }
                    }
                //lstResults.Clear();
            }

        }
        return strresults;
    }

```

I need output:
If min = 30 and max = 37 then the output is 
 "Truth is fiction. Safety is danger.“
because the two sentences are consecutive sentences with the desired length.

Answer: 
change `method` to `type` as following

```
function sendEmail(){
        $.ajax({
            url: "http://formspree.io/email1@gmail.com",
            type: "POST",
            data: $('#emailForm').serialize(),
            dataType: "json",
            success: function(result){
                $("#success").html("Message successfully sent");
            },
            error: function (request, status, error) {
                $("#success").html("Oops! Something went wrong. Please try again");
            }
        });
        return false
    }

```
The error you are getting might be related to something in your server or your server code.

Try copying the request headers and parameters to a [json poster](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo) and try sending the request from there, if you still get an error that means it's in your server or that your request is missing some headers maybe.

After you will manage to send a valid post request it will be match easier to convert it into ajax request.