通过电子邮件发送使用jQuery收集的字符串

I am trying to email a string that was collected from a web page via php, however I am not having any luck. Lots of info on making jQuery forms but can't find any that are simply emailing a string.

here is what I have so far:

 $('.questionFive').click(function(){
    $.post("mail.php", preSubmit()) 
 });

// this works well, and returns the string as desired.
function preSubmit(){
    var optionTexts = [];
    $("section").each(function(){
        var h2 = $(this).find("h2").text();
        optionTexts.push(h2);
        $("ol li", this).each(function() { optionTexts.push($(this).text()) });
        optionTexts.push("
");
    });
    var optionString = optionTexts.toString();
    var splitText = optionString.split(",");
    alert(splitText);
    return splitText;
}

// mail.php file
<?php
if (isset($_POST['mailstring']) {
    $mail = $_POST['mailstring'];
    mail('me@email.com', 'My Subject', $mail);
}
?>

Change the return on the preSubmit function to

return {"mailstring":splitText};

You're sending a single string as your POST data, but your PHP script is expecting a key/value pair. If you look at the jQuery docs for $.post(), you'll see that you have to pass an object as the data parameter:

$.post("mail.php", {
    foo: "bar",
    abc: true
});