How can PHP be used to process form submissions and send emails without relying on mailto?

To process form submissions and send emails in PHP without relying on mailto, you can use the PHP `mail()` function to send emails programmatically. This function allows you to set the sender, recipient, subject, and message body of the email. Additionally, you can use PHP to validate and sanitize form inputs before sending the email to prevent security vulnerabilities.

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $to = "recipient@example.com";
    $subject = "Form Submission";
    $message = "Name: " . $_POST['name'] . "\n";
    $message .= "Email: " . $_POST['email'] . "\n";
    $message .= "Message: " . $_POST['message'];

    // Send email
    if (mail($to, $subject, $message)) {
        echo "Email sent successfully.";
    } else {
        echo "Email sending failed.";
    }
}
?>