function dpsc_pnj_send_mail($to, $from, $name, $subject, $msg, $attachment = FALSE) {
global $wpdb;
$headers="MIME-Version: 1.0" . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . ' ' . $from . '' . "\r\n";
if ($attachment) {
if ($dp_shopping_cart_settings['dp_shop_pdf_generation'] === 'checked') {
$mail_attachment = array(DP_PLUGIN_DIR. '/pdf/invoice_' . $attachment . '.pdf');
@wp_mail($to, $subject, $msg, $headers,$mail_attachment);
}
else {
@wp_mail($to, $subject, $msg, $headers);
}
}
else {
@wp_mail($to, $subject, $msg, $headers);
}
}
The above is the code we’re using on another site. Works.
Related Posts:
- How can I send an email using PHP?
- Disable email notification after change of password
- WordPress and magic quotes
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- Reposition WooCommerce breadcrumb outside of wrapper content
- How do I override the Message-ID header of wp_mail function?
- WordPress URL Rewrite not working
- Displaying a WooCommerce product via PHP
- WP E-commerce: Showing 3 random products from current category when viewing product
- Woocommerce -How to set product regular price default
- How to disable wordpress confirmation email for new users
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- WordPress widget in custom theme
- Bulk Image upload and one image for each post?
- Best way to create a user programatically
- Woocommerce price including tax with formatting from options
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Woocommerce HTML email option unavailable
- woocommerce and is_user_logged_in() if not redirect to homepage
- Woocommerce Custom CSV export
- Trigger Woocommerce New User Email
- Processing a subscription form with POST method?
- WooCommerce – Fixed quantity of a product [closed]
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- WP_cron won’t trigger my action
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- Sending email from inside a plugin using PHP PEAR
- How to create a custom category of wordpress admin
- Adding a div at the bottom of a sidebar
- How to run JS, PHP and etc. inside WP post?
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Set a condition based on WooCommerce checkout city field while placing order
- Working with wordpress plugin and theme templates structures
- WordPress: Access a plugin from within a theme
- WordPress plugin/code to hide all things related of a user from the public
- PHP 8, AJAX mail form to function.php doesn’t work
- Capture User Email Address When Filling Out Form
- How to retrieve the sender email with wp_mail()?
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- showing 2 prices wholesale and normal
- Notify comment author upon reply
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- How can I hide that I Use WordPress (with W3 Total Cache)
- Woocommerce Show Single Product on Homepage
- WooCommerce Tabs [closed]
- WordPress add_rewrite_rules for custom URLs ending in .html
- Can I get an email notification when media is uploaded to the media library?
- Woocommerce Email attachments not working – file not being attached
- How to solve Woocommerce Memory Limit
- Should i use the wordpress Options table or to create database table..?
- Why doesn’t PhotoSmash plugin play well with wp_query?
- Send email with list of active plugins upon activation/deactivation
- WordPress: Add custom add_filter for custom functions
- Get user custom field value on function.php
- Pass return-path additional parameter in wp_mail
- difference between sanitize_email ,FILTER_VALIDATE_EMAIL and input email type in html5
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- feedburner plugin for WP 3.5
- Display additional page templates and a sidebar on plugin activation
- Use of antispambot with $curauth->email
- Make separate text boxes for separate WordPress Custom Fields
- Contact form – problem with displaying message about sent mail
- How to setup the Email piping in WordPress plugin?
- Is it secure to use SMTP password in .php file in WordPress website?
- Send an e-mail on address with the link with disliked post
- I want to fusion the product columns in email table order
- How to change a wordress plugin php code in my child’s functions.php file?
- Woocommerce checkout page – custom field checkbox value into email
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Creating a WordPress addon for ContactForm7 submission (.XML file export)
- Send email to users when they get new followers
- How can disable wordpress emails notifications?
- Form tries to download a file on submit
- Woocommerce custom field on emails outputs ‘Array’
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Wp_mail doesnt work
- Trying send mail from Theme page
- divide custom field values in div every two values
- WordPress plugin creating sidebar on the theme/page
- WordPress and magic quotes
- How to get WordPress Adminmenu items?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- get_post_meta is always empty when I use wp_mail
- Cron job to call php to email last 24 hours posts
- How to check “From Email” via WordPress before an email is sent
- Simple tree display of WordPress menu
- WordPress Pages into Sections edit.php PHP hack
- WordPress Plugin Receive a Link
- WordPress: Create A Widget to Accompany Plugin
- How can I list only Subcategories in Woocommerce
- PHP Syntax getting PHP terms
- Adding multiple emails to a
- How can I prevent wordpress from sending emails
- Get Products within Current Product Category
- Dynamic Email Handler with ‘header (“Location: …’
- what is %variable% in a wordpress plugin? [closed]
- Customize the summary table of an order in the email
- Why does WordPress not send the user the email to add a password?
- Why is my custom email notification after purchase not sending?