Is it possible to use JavaScript to send an email when a user right-clicks and saves an image?
To send an email when a user right-clicks and saves an image using JavaScript, you can create an event listener for the "contextmenu" event on the image element. When the event is triggered, you can make an AJAX request to a server-side script (e.g., PHP) that sends the email. ```javascript document.addEventListener('contextmenu', function(e) { if (e.target.tagName === 'IMG') { e.preventDefault(); // Make an AJAX request to send an email // Example: // fetch('send_email.php', { // method: 'POST', // body: JSON.stringify({ email: 'recipient@example.com', imageSrc: e.target.src }) // }) // .then(response => { // if (response.ok) { // console.log('Email sent successfully'); // } else { // console.error('Failed to send email'); // } // }) // .catch(error => console.error('Error:', error)); } }); ```