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?
- What is & used for
- How to define form action in JSF?
- Free or affordable OCR and ICR (handwriting recognition) SDK?
- Send a copy to yourself with Contact Form 7 in WordPress
- How to include landing page with form submission?
- How to edit a user profile on the front end?
- How to display user registration form on front-end of the website?
- Contact Form on WordPress Sites?
- How to handle form submission?
- What is an easy way to display a front-end user registration form?
- Add error message on password protected page
- Check if post is being published for the first time, or is an already published post being updated
- how to set from address according to the form input email address for wp_mail()?
- Is wp_nonce_field vulnerable if you know the action name?
- How to pass on Google Adwords gclid variable to other pages
- Refresh page after form action
- using update_user_meta in form to set and get custom meta
- Best way to create multi-step form with data saved to user account for later updating?
- User registration problem in WordPress
- Creating a contact form without a plugin [closed]
- How to submit data from HTML form?
- Custom Registration Template/Page
- show image in mail contact form 7 [closed]
- Can I verify nonce which was generated on a different WP site?
- WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)
- Submitting post to database then redirecting to paypal
- Registration form labels – add asterisk
- Autocomplete for taxonomy input boxes on a front end form
- 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 handle forms in multiple pages?
- Transferring contact form input to an email account without using an email-proxy
- set_query_var doesn’t seem to work on init hook
- Prevent function from triggering again when post in specific category gets another category?
- How to send multipart form data to WordPress endpoint
- need to add attach thumbnail from my form
- Wp_mail Returning False on Server
- recommended practice for form submission
- Contact Form 7 plugin refreshing page on submit [closed]
- Placeholders in Jetpack Contact Form [closed]
- Action hooks returning old category instead of new category
- How to update selective options on plugin settings page
- Built-in data validation function for URLs
- $_POST empty on submit (same code, same form submits normally on local server)
- Gravity Forms skip form if already filled out using cookie?
- Loading scripts & styles from a meta box callback function
- Checkbox won’t check when label is clicked
- Custom function for “Submit for Review” hook
- One comment per user per post
- How to sent one form values to 2 different sites in wordpress
- Looking for a simple approach for handling user $_POST data without AJAX?
- Trying to save and display a wp_editor()
- How to return variables from admin-post.php
- Help with verifying google recaptcha in a custom form
- Nonce actions and names available via open source
- Setting specific image size for specific form upload file field
- Duplicating/Cloning Multiple Form Fields
- WordPress registration and contact form 7 [closed]
- Get data from dropdown and update page
- Mail Form in a modal box without plugin
- Processing a subscription form with POST method?