Files not attached to email
-
Hi there and thanks for the great form plugin.
I’ve made a form that has a few multi-file upload fields, just for JPG and PDF, and everything seems to work except the files won’t attach to the email. Instead, the notification shows them as links.
I’ve applied the notification setting to attach uploaded files and I’ve read the other couple of support tickets here with the same query, but there isn’t a fix on those.
I’ve got it set to not show the files in the media library and to delete after 10 days. The files are present on the server in \wp-content\uploads\sites\5\2022\08.
Any advice is appreciated.
RobWordpress 6.0.1
Software: Microsoft-IIS/10.0
MySQL version: MySQL Community Server (GPL) v5.7.34
PHP Version: 7.4.13
PHP Memory Limit: 512M
-
Hi @robaxxx,
I’m not able to replicate such an issue when tested. The files or images get attached in the email when tested.
Could you please share your form export to see how it behaves when tested with your form?
Please check the following doc on how to export a form:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-exportYou can share the export file via Google Drive, Dropbox or any cloud services in the next reply.
Looking forward to your response.
Kind Regards,
NithinThanks for checking this Nithin
I’ve uploaded the file here:
https://drive.google.com/file/d/1kcvnVsfdeMngCCnCxV0HK1cUEr-ZbMlq/view?usp=sharingRegards
RObHi @robaxxx
Thank you for the form.
I couldn’t replicate the issue: https://monosnap.com/file/bibue0PHvYqeGRPVRA1Irh7C39cnmb
The files are being attached to the email as expected.
Could you try on a different email like Gmail just to confirm it is not your email provider preventing the attachments?
Are you using any SMPT? If so, could you please try to disable it and try without any SMTP plugin?
Let us know the result you got.
Best Regards
Patrick FreitasHi Patrick
Thanks again for looking at this. I’ve spent some time on it again today to try and figure it out. I made these notes:
Form tests:
I made a copy of the entire WP instance for testing and I set up a simple form with just name, email and single file upload.I was using Branda for SMTP at network level, but for testing I disabled that as well as all other plugins, both at network and site level. It is now using PHP Mailer.
I enabled WP Debug for a test send but it logs nothing when form is submitted.
I checked PHP74_errors.log but it also shows nothing at point of submission.I enabled the WP Mail Catcher plugin, which I use to monitor and log emails.
For the form email submissions, it says: “An attachment was sent but it was not in the media library”
So I changed the Forminator settings to show the files in the WP Media Library, but the result is the same.
The files are certainly present. I can see them and clicking the links in the email retrieves them.To determine whether any emails with attachments can be sent at all, I looked for another form plugin to test and found Contact Form 7 would let me attach files.
Testing the same simple form on that plugin reports the same message in WP Mail Catcher, but now the email has the file attached, indicating that the web and email server environment works for the purpose (hurrah!).
In the Contact Form 7 docs it says that it uploads the file to a temporary folder, sends the email and then deletes the file. I can see this happening when I watch the folder on the server.
I re-enabled Branda SMTP and tested Contact Form 7 again and it worked again.
So the question is.. what are these forms doing differently? Does Forminator do something that requires something special to be present.. e.g. a PHP module or setting? Is there another log somewhere that would provide more details perhaps? Permissions seem to be fine as both plugins were able to manage the files.
Notes: This is a multisite WP instance with separate domains for sites. I set this instance up around WP version 5.8x so it’s fairly fresh. The mail server is my own copy of Smartermail Enterprise and it runs on the same Windows 2019 server as the sites. It doesn’t remove attachments. It’s my own dedicated server. Just mentioning that it’s IIS in case something has been done in the plugin that wouldn’t work on IIS, such as requiring htaccess files for functionality.
Still hoping this can be made to work as I like Forminator best and already gave it 5 stars a while ago ??
Regards
RObHi @robaxxx
Thank you for response and all this additional info.
Taking it all into account, I’m thinking that this may somehow be related to paths. Perhaps when about to send attachment Forminator isn’t able to actually fetch the file correctly?
I don’t have much experience with IIS server, nor do I have a way to test it, but I’m wondering about something:
If (in addition to enabling attachment) you add upload field macro (like {upload-1} though number may be different depending on your form; I don’t know specifics as your form export is no longer available) – what is the path that it outputs in e-mail after form submission? Is it correct and if you click on it – is the file showing up or is there some access error?
Kind regards,
AdamHi Adam
I just made a simple form with email and upload to avoid any issues with the big form.
I’ve added the token as suggested and that produces a link matching the one already included in the email. Both links work, indicating the permissions are all correct.
Would it be some sort of timing issue.. i.e. it’s trying to get the file before it is available?
Could the person who programmed this particular feature look at the Contact Form 7 source code and see what it’s doing different from Forminator? There’s clearly some detail that matters. https://github.com/wp-plugins/contact-form-7
I’d be happy to test anything or set up an instance for examining/debugging on my server.
Is there a version of Forminator you use for debugging maybe? I come from the DotNetNuke scene and devs there sometimes send me a special version of a plugin to log and debug issues.
Regards
RobHi @robaxxx
I hope you are doing good today.
Is there a version of Forminator you use for debugging maybe? I come from the
DotNetNuke scene and devs there sometimes send me a special version of a plugin to log and debug issues.
We do not have anything like that. The only versions we have are Beta versions with fixes before new release.
Could you make one more test if possible, before we consult this case with devs, so we could have a better picture? As this is your own server, we would like to confirm same scenario from your side with a copy of your site, with the same settings, on a hosting that is outside your server. This will put more light here that some configuration from your own server affects this possibly.
Kind Regards,
KrisHi again
That was a huge ask and took me a lot of stuffing around but I’ve done it now. I don’t have free Windows servers falling out of my sleeves so I had to find one I could set up from scratch for free.
I set up an account at Azure.microsoft.com and used their free trial to set up a Server 2019 resource. Then I spent last night and today sorting out all the necessary bits and doing tests. I’ve completed that now and the outcome is the same… as expected.
Added Microsoft Server 2019 Gen1 resource
Added role Web Server
Installed:
PHP 7.4.13 (x64) via Web Platform Installer
PHP Manager 1.5.0 for IIS 10 from https://www.iis.net/downloads/community/2018/05/php-manager-150-for-iis-10
MYSQL Workbench 6.3.10 from https://downloads.mysql.com/archives/workbench/
Latest MySQL installer 8.0.28 from https://downloads.mysql.com/archives/installer/
Used that to install 64 bit MySQL 5.7.34 Community ServerNo special configuration needs to be applied. Everything in IIS, PHP and MySQL are at defaults.
Added DB with Collation: utf8mb4 – default collation and created new DB user
Added site to IIS
Put latest WordPress in the site folder and fired it up – all good.Installed ‘WP Mail SMTP’ and set it up with my smtp server. Works fine.
Installed Forminator
Added form with only email and a single file upload field.
Added form shortcode to a new blank page.Multiple tests with Forminator send the form submissions but won’t send the attachment as originally reported in this thread.
Installed Contact Form 7
Added file upload field and file attachment tag to default contact form following docs: https://contactform7.com/file-uploading-and-attachment/
Added form shortcode to a new page.
Sent test with file attachment and it all comes through correctly…. works!That was a day to confirm what I’d already found, and although I used a different SMTP plugin in place of Branda in case it mattered, the result was the same.
I can let your dev into this test server via RDP to try any fixes out, but I would have them look at the Contact Form 7 Github I linked previously and see how they made it work.
Attaching files obviously works in the environment, just not in Forminator. It can’t be impossible to resolve.
Happy to assist further but that was a lot of time just to repeat what I already knew. I’ll keep the Azure server going until it’s not needed.
Thanks
RobHi @robaxxx
Just to make sure we are on the same page, are you having the issue on Win servers or had tested on the Linux servers too?
In case it is happening in a specific environment that could be the issue, please let us know so we can run a couple of tests from our end.
Best Regards
Patrick FreitasHI Patrick
Yes, the environment is as detailed in the first post. All of the applications required by WordPress… PHP, MySQL are official Windows programs and I’ve used both 32 and 64 bit versions. In the last post I made I detailed the installers and indicated that everything is at defaults.
I’m not aware of any additional requirements or special settings that need to be applied to make things work and I’m not using any caching or anything else funny. The other form plugin I tested confirms that sending notifications and attaching documents works in the default environment.
You can have access to the server I set up for testing purposes. It’s ready to go and has nothing else on it. Might save you some time. Just let me know where to send the login if you want it.
Regards
RobHi @robaxxx,
Thanks for providing further info. Do you think it is possible also to provide a public URL where you have the form so that it would also give us a better idea while testing on your page?
Looking forward to your response.
Kind Regards,
NithinHello @robaxxx ,
We haven’t heard from you for some time now, so it looks like you don’t need our assistance anymore.
Feel free to re-open this ticket if needed.
Kind regards
KasiaI’m still on this, just have to spend more time to figure out how to get an external URL to a site on the Azure trial server.
You’re making me jump through all these hoops here and it takes time. You could of course just go with my offer and let me give you access to the server. Then you could see it all yourself.
Otherwise I’ll have another go at the URL tomorrow.
Hi @robaxxx,
As we requested in our previous response, could you please provide a public URL where you have the form so we can take a closer look at this?
Please use our secure contact form to share the public URL safely: https://premium.wpmudev.org/contact/#i-have-a-different-question
– To mark my attention, the subject line should contain only: ATTN: Nebu John
– the public URLWe look forward to hearing back from you.
Kind Regards,
Nebu JohnHi
I’ve submitted that form and pasted the following into the subject field:
ATTN: Nebu John – the public URLLooking at it now, that may not be exactly what you meant. In any case, see if you get it.
- The topic ‘Files not attached to email’ is closed to new replies.