AI Summary
Most people who need to send an email with attachments in WordPress are trying to solve something fairly ordinary. A visitor uploads a document, a photo, or a signed contract through a form, and you want that file to arrive in your inbox.
The good news is that the most common version of this needs no code at all. There are three practical ways to attach a file to a WordPress email, and the right one depends on where the file is coming from in the first place.
I’ll walk you through all three, starting with the one most people actually want. Then I’ll cover the delivery problem that catches almost everyone off guard once attachments start flowing.
How to Send an Email With Attachments in WordPress
You can attach files that your visitors upload through a form, attach a generated PDF or CSV of the submission itself, or attach files with code from your own plugin or theme. The form method covers most real situations and takes about five minutes to set up.
- Step 1: Install the WPForms Basic Plugin
- Step 2: Create a Form With a File Upload Field
- Step 3: Attach the Uploaded Files to Your Email Notification
- Step 4: Send a Test Entry and Confirm the Attachment Arrived
- Other Ways to Send WordPress Emails With Attachments
- Why Your WordPress Email Attachments Aren't Arriving
Step 1: Install the WPForms Basic Plugin
WPForms is the form builder I’ll use for the first two methods. It ships with 2,100+ WordPress form templates to start from, including a ready-made file upload form template that already has the upload field in place.
What I like about handling attachments this way is that the upload field and the email settings live in the same screen. You’re not bolting a code snippet onto a form plugin and hoping the two agree with each other, and you can change the file size limit and the notification in the same sitting.
File uploads and notification attachments both unlock at a paid license, so you will need Pro which unlocks 40+ powerful addons, conditional logic, and a lot more!


To get started, buy the Pro license. Then install WPForms on your website. If you need help, follow these instructions on how to add a plugin to WordPress.
Step 2: Create a Form With a File Upload Field
Now that we’ve got WPForms Pro installed, we can dive under the hood to create a powerful file upload form that will send attachments to your email.
One of the really cool things about WPForms is how easy it is to get started with form building. You’ll have 2,100+ WordPress form templates to choose from, including a pre-built file upload form template.
For this guide, we’ll simply use this template, but don’t forget that you can add a file upload field to any form. So, to get on with building our form, we’ll head on into the WordPress admin area and click through WPForms » Add New.


Once in here, we’ll look for the file upload form using the search bar. When you find it, click Use Template, and the form will open up in the form builder.


If you’re starting from scratch with a blank template or any other template, you can find the file upload field by scrolling through the form field panel to the Fancy Fields section.


Drag and drop the file upload field on the form at the point where you want it to be. At this point, you’ll have a basic file upload form that you can enhance by:
- Max File Size: Leave it blank to use your server’s limit, or enter a smaller number to cap it yourself. Hover the question mark icon to see what your server currently allows.
- Max File Number: This defaults to 1, which is easily the most common reason only one file turns up in your inbox. Raise it if visitors need to send several at once.
- Allowed File Extensions: WPForms already accepts common documents, images, audio, and video, so you only need this field when you want to restrict things further.
- Style: Modern gives you a drag-and-drop box and supports multiple files. Classic shows a single Choose File button and won’t accept multiple uploads at all.
- Store file in WordPress Media Library: Sits on the Advanced tab, leave it off and uploads stay in a WPForms folder inside your uploads directory instead.
That Style setting trips people up more than you’d expect. If you raise Max File Number but leave the field on Classic, visitors still only get to send one file.
There’s a fuller breakdown of every option in the complete guide to the file upload field, and the file uploads feature page has the shorter overview.
Step 3: Attach the Uploaded Files to Your Email Notification
From the form builder, navigate to the menu on the left of the form field panel, and click on Settings » Notifications. Once in, first, make sure the Enable Notifications button is toggled on.


Scroll down and click Advanced to reveal more options, then toggle the button labeled Enable form file upload attachments.


You’ll then see another section labeled File Upload Fields, which will have opened up in a dropdown below it. Click on the dropdown to choose the form field to pull attachments from.
In this case, you have only one file upload field on your form labeled File Upload. Select this field and save these settings.


If your form has more than one upload field, this is the part worth slowing down for. Each field has to be selected individually in that dropdown.
Picking just the first one means the other uploads never get attached, and nothing in the interface warns you about it. While you’re in this panel, you’ll also see a toggle called Enable Entry CSV Attachment.
That one attaches a spreadsheet of the submitted data rather than the uploaded files, and I cover it a bit further down.
The official docs on attaching files to form notification emails walk through the same settings if you want a second reference, and you can change the look of the email itself with these tips on how to customize form notifications.
Step 4: Send a Test Entry and Confirm the Attachment Arrived
To check that your form sends file uploads to your email as it should, we’ll need to embed it into a page and publish that page on the frontend of your site. For detailed steps, please take a look at our guide to embedding a form on a page in WordPress.
With your form published on the frontend of your website, go ahead and fill it out and attach a file to it using the file upload field.
And when you check your email, you’ll now see the file upload attached to the email which you can directly view or download.


The file should be sitting there as a genuine attachment you can open or download straight from the email.
If the notification arrives but the attachment is missing, or the email doesn’t show up at all, skip ahead to the delivery section below, because that’s almost always a file size problem rather than a settings problem.
Other Ways to Send WordPress Emails With Attachments
Uploaded files are only one kind of attachment, and two other situations come up often enough to be worth covering.
Sometimes the thing you want to attach doesn’t exist until the form is submitted, like a receipt or a record of the entry itself. Other times you’re sending mail from your own code with no form involved at all.
Attach a PDF Copy of the Submission
The PDF addon generates a styled PDF from the submitted entry and attaches it to the notification, so the recipient gets a proper document rather than a wall of form fields in an email body.
You pick a template, adjust the theme, and control who’s allowed to open it, all of which needs a Pro license. The full setup is covered in this guide on how to send a PDF attachment in a form notification email.


Attach a CSV of the Entry Data
This is the Enable Entry CSV Attachment toggle from Step 3, sitting in the same Advanced panel under your notification settings. Switch it on and every notification carries a small CSV of that submission’s data.
It’s a Basic feature like file uploads, so there’s no upgrade involved, and it pairs well with forms that collect a lot of structured fields. The docs on attaching CSV files to form notification emails have the details.


Attach Files With Code
WordPress has attachment support built into its mail function. The fifth parameter of wp_mail() takes a file path, or an array of file paths when you need to send several, and they have to be absolute server paths rather than URLs.
wp_mail( $to, $subject, $message, $headers, $attachments );
Those paths point at real files on your server, which means the file has to be saved somewhere before it can be attached.
If what you’re really after is adding an extra file to a WPForms notification programmatically, our developer docs cover attaching a file to email notifications with code without you having to rebuild the notification from scratch.
Why Your WordPress Email Attachments Aren’t Arriving
This is the part almost nobody plans for, and it’s the reason most people end up searching for help. Once your visitors start uploading real files, some of those emails will quietly fail to arrive.
The cause is usually size, and there are two separate ceilings involved. Your server has an upload limit that governs what a visitor can put into the form, and your email provider has its own limit on how large an attachment it will carry.
The fix is to work backwards from your mail provider instead of your server. Find your mailer’s attachment limit, then set Max File Size on your upload field comfortably below it.
If you need to raise what visitors can upload in the first place, here’s how to change the max file upload size in WordPress.
And if notifications aren’t arriving even with small files attached, the problem sits upstream of attachments entirely, so start with this guide on how to fix email delivery failures in WordPress.
For genuinely large files, the better move is to route the upload to cloud storage and send a link instead of an attachment, which keeps your notifications small and your inbox usable.
FAQs on Sending Email With Attachments in WordPress
Sending an email with attachments in WordPress raises a few recurring questions, especially around who receives the file and what happens to it afterward. Here are the ones readers ask most often.
Can I send the attachment to the person who submitted the form?
Yes. Add a second notification and point it at the email address your visitor entered, then enable file upload attachments on that notification too.
Each notification carries its own attachment settings, so the copy going to your visitor and the copy going to your team don’t have to match. The docs on sending a notification email to the person who submitted the form cover how to set the recipient correctly.
How do I attach the file instead of just linking to it?
Switching on Enable File Upload Attachments attaches the real file, so that part is already handled. What confuses people is that the email body may still show a download URL as well, because the {all_fields} smart tag prints every submitted value including the file link. Replace it with the specific field smart tags you want and the URL disappears while the attachment stays.
Can I attach more than one file to the same notification?
Yes, with two settings to check. Raise Max File Number above 1 on the upload field and set the Style to Modern, since Classic won’t accept multiple files. If your form has several separate upload fields, remember to select each one in the File Upload Fields dropdown.
Do uploaded files stay on my site after the email is sent?
They do. Attaching a file to a notification sends a copy, it doesn’t move the original. Uploads live in a WPForms folder inside your uploads directory by default, or in your Media Library if you enabled that option on the field. They also stay attached to the entry in your WordPress dashboard, so you can download them later without digging through email.
Can I send an email with an attachment in WordPress without a form plugin?
Yes, using the wp_mail() function described above. Pass an absolute file path as the fifth parameter, or an array of paths for several files. It’s the right approach when the email is triggered by your own code rather than a form submission, though you’ll be writing and maintaining that logic yourself.
Next, Build Out Your File Upload Form
Once emails are landing properly, it’s worth tightening up the form itself with file type restrictions, clearer instructions for visitors, and a confirmation message that tells them the upload worked.
This walkthrough on creating a file upload form in WordPress covers the settings that matter most. After that, test one more submission with a realistically large file rather than a tiny placeholder.
Create Your File Upload Form Now
Ready to build your form? Get started today with the easiest WordPress form builder plugin. WPForms Pro includes lots of free templates and offers a 14-day money-back guarantee.
If this article helped you out, please follow us on Facebook and Twitter for more free WordPress tutorials and guides.



What if you want to send the person who fills out your form an email with an attachment?
Hey Jonathan – you can absolutely set up an auto response / thank you email where you can write HTML response, include attachment (by adding URL of the attachment) to the user who filled up the form. We have a step-by-step tutorial about this (and other aspects of setting up form emails) in this doc.
I hope this helps. Thanks 🙂
Hi,
How can I get the uploads not as a link and only as an attachment. Right know it is really insecure because you can access the data via a the link…
Hey Hannah – If you don’t want to have the file upload URL on your email notification, just use {field_id=”#”} instead of {all_fields} in the email message as shown here.
Just in case it helps to share, we add a unique hash to the end of the file URL that are uploaded by the user (eg: my-logo-570543445db74.png) so that a malicious user couldn’t easily open up a bunch of files that have been uploaded to your site or can’t guess other fiels URL unless they get the exact file URL via email.
Hope this helps! Thanks 🙂
Is there any way to control how the file is attached versus embedded? I have multiple recipients setup and some of them are having trouble printing the e-mails with images. I’ve suggested they change their e-mail programs printer settings but they still end up missing when printed. Our company does this for record keeping.
Hi Travis – When you get a chance, please drop us a line with more details about the issue you are facing in support so we can assist further.
If you have a WPForms license, you have access to our email support, so please submit a support ticket.
Otherwise, we provide limited complimentary support in the WPForms Lite WordPress.org support forum.
Thanks 🙂