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 the same file path as in your “flat HTML file structure”.
Your action code will then be action="http://damtech.it/demo/etap/scripts/phpmailersub.php"
Easy as that. No need to create a plugin at all (although this may be better practice). Don’t forget to change the details within phpmailersub.php to accommodate the changes made in terms of attachment paths (server path), page directs etc.
Related Posts:
- WordPress Emails & Contact Forms [closed]
- Email from my theme’s contact form doesn’t get the reply-to address right
- Email form getting hacked
- What characters are allowed in an email address?
- How to get current url in contact form 7
- Contact forms going into spam folder
- other shortcodes in Contact form 7 MAILS [closed]
- Obfuscating Email Addresses in Form Fields
- Add contact form
- Creating a contact form with Laravel frontend
- Can you disable the mail function in contact form 7 [closed]
- Make a form that will send email to all the authors in selected category [closed]
- Using Contact Forms to Send Private Information [closed]
- Contact Form 7 not sending emails- no confirmation, no error [closed]
- Remove field in the form : only works for “url”, not for “email”?
- PHP form is not sending mail if I use mime type and version in header. How to solve this? [closed]
- Downloadable content only for subscribers?
- advanced custom fields and contact form 7
- form action wordpress and php
- Saved emails at dashboard
- Dashboard Contact Form
- How can I receive uploaded attach file as a Google drive link [closed]
- Contact form – problem with displaying message about sent mail
- WordPress – Users with contact form on profile
- Am receiving more than thousand mails in single day from ‘[email protected]’ continuously
- Why is my contact form not working?
- Sending Form data as Attachment
- How to send custom mail when a user complete a specific form
- Sending email via function in page or setting up the action properly in another page
- Send contact form to a specific referrer-email adres
- Contact form spam, without form?
- Username from e-mail
- Custom Contact Form Not Sending (but not giving error)
- Send message to author without showing email address [duplicate]
- How to add contact form instead of checkout
- Submit button returns to index page instead of sending data
- Form that stores emails [closed]
- How can I add email code authentication on form submission without any wp plugin?
- using update_user_meta in form to set and get custom meta
- User registration problem in WordPress
- show image in mail contact form 7 [closed]
- Submitting post to database then redirecting to paypal
- How to create and retrieve data from a special registration form?
- Contact form 7 Dynamic text – placeholder on GET field
- Settings API erases itself?
- How to update selective options on plugin settings page
- Loading scripts & styles from a meta box callback function
- Help with verifying google recaptcha in a custom form
- Mail Form in a modal box without plugin
- Processing a subscription form with POST method?
- How am I able to get the value out of cookie array when I push a button?
- How to implement post/redirect/get pattern on contact form
- WordPress action admin_post for non-admin authenticated users – Form submission
- Instantiating classes through add_action and saving them to user_meta data [closed]
- Create form on plugin options page that creates submenu pages for that plugin
- How can I create registration form for users which I can assign role and profile picture?
- Show the submitted values in the form when validation fails
- Contact Form 7 form is working on local wordpress install but fails on production server [closed]
- How can I redirect this contact form to a specific permalink
- Comparing formidable pro and gravity forms [closed]
- Programmatically populate form fields with data
- Stop SPAM from custom form
- Display Freebie Page Content only if Referrer is from Form Page
- Init action and refresh page after form action
- Custom tables and using wpdb to insert into DB from a html form
- Custom form handling in WP.. the correct way?
- How to use HubSpot Forms API in WordPress pages?
- Front end update_post_meta Help
- retrieve all emails as database in wordpress to view all sent emails
- Contact Form 7 Plugin emails not being received by some accounts
- How to stop direct HTTP POST to a PHP script?
- Embed IPB forums to wordpress page
- Unable to upload data to Media Libary
- How to add custom regex validation to WPForms password field
- Submit Multi-Part Form After Each Part
- Populate a custom form with user data [closed]
- How to Best Create Separate Subscribers and User Experience
- Caldera Forms Manual formula
- How to change lost password email text using custom plugin wordpress?
- Form element name – array type is not working
- Postback redirect through add_action is not triggered
- Embedding Links to WPForms on a WP Page
- Scroll Form with page scrolling and add form on slider
- Back button not working after input / search submit
- I am trying to add checkbox for anonymous post on form post
- How to change form action of wp-login page with a function
- Simple filter to change label name of Email Adress to something else
- Custom transactional emails on user signup with wp_add_user
- WordPress, Front-end send message to authors using plugin when their post is published
- Generating unique PDF download link after user input
- Why doesn’t a form need an ‘action’ with a plugin that uses the post data?
- Update a string from the front-end
- What add_action reference should I be using or should I use do_action?
- Update post meta without deleting the old entries
- How to creat form with get method and receive it
- Custom form values without plugin [closed]
- Correct Syntax for uploading files to custom directory in WordPress
- From contact form to paypal
- Dynamic price for payment button
- How to use tag in wordpress?