You aren’t adding slashes to $wp_content. In functions-post.php, go to line 48 and add:
$post_content=addslashes($post_content);
to fix this problem.
This is a security issue in my opinion. It’s bad all around. The wp-mail.php is open to the world and database errors are visible as well. A malicious user can not only send bad data to a query, but even view the query before you ever do. This needs to be patched.