Sending form data via PHPMailer – How to action PHP script from a form
You are actually closer in your first attempt. My recommendation would be to create a folder called “scripts” in the WP root and put your PHP script files in here as well as your attachment(s). You will then need to declare the full path in your action attribute as the script does not now share … Read more