you can use wp_mail( $to, $subject, $message, $headers, $attachments );
to send emails with attachments.
So all you need is a simple form
<form name="email-att" id="email-att" method="POST" action="">
Enter your emial: <br />
<input type="text" name="email" id="email"/><br />
<input type="hidden" name="action" value="email-att"/><br />
<input type="submit" name="submit" value="submit" id="submit"/>
</form>
and to process it
<?php
if (isset($_POST['action']) && $_POST['action'] == "email-att"){
if (is_email($_POST['email'])){
$to = $_POST['email'];
$subject = "email subject line";
$message = "email message body";
$attachments = array('http://full_url_to_file.zip');
wp_mail( $to, $subject, $message, '', $attachments );
echo 'mail sent! check your email';
}else{
echo 'Please enter a valid email address ';
}
}
?>
Related Posts:
- Disable email notification after change of password
- Getting Path To Uploaded Attachment Image After Upload
- wp_mail and BCC headers
- Sending all emails using SMTP
- Email Notifications of new posts to users – suggestions [closed]
- How to add usermeta to “Notice of Email Change” email message
- Moving image attachment from post to another?
- Notify commenters about new replies
- How can I get an image from the uploads dir and enter it in the media library? [closed]
- Send batch of posts as HTML Email?
- Plugin for Sending Email to Readers about New Posts? (besides “Subscribe2 “)
- How to get custom field image url of specific size
- How to bulk send emails
- Server-side subscribe by email?
- Converting a simple plugin to be placed inside of functions.php
- WP Mail SMTP: What do the SSL/TLS options mean? [closed]
- A very basic question – how to properly use wp_mail() in a plugin
- Set attached to state
- WordPress plugin for mail subscriptions [closed]
- Is there a plugin to record querystring parameters for a page (for customer tracking)? [closed]
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- action-scheduler vs wp-background-processing
- How to get images from EDD post?
- How can I get full attachment url from wp_get_attachment_metadata?
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Easy Digital Downloads (EDD) – Purchase Receipt emails couldn’t be logged
- Converting Attachment to Images?
- WordPress sending emails continuously. How to stop it?
- Setting Custom Email From name and email address in wp_email()
- Get the url of the full sized attachment image using post ID?
- how to incude logo in contcat form 7 email [closed]
- Check if email address exists front end with AJAX in a plugin
- Randomize attachment IDs
- Woocommerce email template customization [closed]
- Sending email from inside a plugin using PHP PEAR
- Can’t send mails using contact plugin [closed]
- Hook into and send mail using WP Mail SMTP type plugin from HTML static front page?
- Limit Number of Taxonomy Terms (Images) Displayed
- WordPress Registration Email by Role
- Media is not attached after import
- Get sent emails without email logs
- How to send an automated email to the customers when product is added woocommerce
- Looking for a way that will collect visitors emails before letting them view the blog posts [closed]
- Display encrypted content on my website
- Sending HTML emails via wp_mail not working properly
- Send email when a portfolio project is updated
- Sync User to cPanel webmail?
- How to pass variables to a function argument using add_action [duplicate]
- Is it possible to send blog posts via email to subscribers?
- Send admin an email when a user’s search has no results
- Looking for advice for a mail sending plugin
- Plugin to email a post or page to someone
- SMTP Error: Could not authenticate [closed]
- Alternate email sending service – eg: AWS SES [closed]
- WordPress: Add custom add_filter for custom functions
- Sending HTML email containing custom fields to site users from WordPress
- Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin
- sending different email notification while registration based on user role
- Function added to hook “new_to_publish” not executing – custom plugin
- Search by Attachment ID
- JSON API Plugin not showing Attachments id reused
- Two WooCommerce installations on the same server, one sends customer emails but the other does not
- Attachments broken after giving WordPress its own directory
- How to add a button to check the emails of my domain?
- Contact Form 7 Plugin emails not being received by some accounts
- In wordpress how to sent different email separetly when i click on different email ids [closed]
- How can I add user profile fields to my mailpress mailout
- plugin for emails to prevent spam but also let mailto working?
- Can Postie be used to submit podcasts via email?
- WordPress – send digital product with custom email
- How to display emails as a post?
- SMTP emails not picking up the correct From name and From email
- submit two file input fields in the same form
- How do I add a medium to the WordPress database with my own plugin?
- Changing the Default New User Notification Email
- How to change a wordress plugin php code in my child’s functions.php file?
- WordPress eMails not working
- Getting unknown text in footer of email
- How to send custom mail when a user complete a specific form
- Do_shortcode before send email content
- admin-ajax.php returning 0
- Plugin sending emails to external addresses, not internal
- Get value from an input field and pass into update_meta_data as $meta_value
- Cron job emails blank
- How can I automatically send an email with an excel file containing submissions for a form rather than an email per submission?
- Attachments plugin cannot click media library button [closed]
- How to force regenerate thumbnails in WordPress posts?
- How to customize ‘recurrance’ of’ wp_schedule_event’?
- Differentiate attachment pages in search results
- Setup SMTP setting in wordpress
- How do I replace the e-mail form to functional e-mail subscription? [closed]
- How to show post attachment image
- Overwrite CSS of Instaemail plugin popup
- Building custom pages with a video player
- Choose User to email when adding a new post?
- How to work email subscribe in WordPress?
- Send Processing Order Email from custom payment plugin
- Woocommerce Emails not being sent [closed]
- WP can’t send newsletters
- WordPress isn’t sending welcome email with the password reset