What are the potential security risks associated with using mailto in form actions in PHP scripts?

Using mailto in form actions in PHP scripts can expose your email address to potential email harvesting bots, leading to an increase in spam emails. To mitigate this security risk, it is recommended to use a server-side email sending method, such as PHP's built-in mail() function or a third-party library like PHPMailer, to handle form submissions securely.

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $to = "your@email.com";
    $subject = "Form Submission";
    $message = $_POST["message"];
    
    // Send email using PHP's mail() function
    mail($to, $subject, $message);
}
?>