Is it possible to send an email using PHP when a user visits a website?

Yes, it is possible to send an email using PHP when a user visits a website. You can achieve this by using the PHP `mail()` function to send an email when a specific page is visited. You can include the `mail()` function in the PHP code of the page that the user visits to trigger the email sending process.

<?php
$to = "recipient@example.com";
$subject = "Test Email";
$message = "This is a test email sent from PHP.";
$headers = "From: sender@example.com";

// Send email
mail($to, $subject, $message, $headers);
?>