Yes! There’s a plugin that does this, and it’s very simple. It uses the phpmailer_init
to adjust the $phpmailer
object. This is the code it uses:
if ( ! function_exists( 'wp_mail_returnpath_phpmailer_init' ) ) {
function wp_mail_returnpath_phpmailer_init( $phpmailer ) {
// Set the Sender (return-path) if it is not already set
if ( filter_var( $params->Sender, FILTER_VALIDATE_EMAIL ) !== true ) {
$phpmailer->Sender = $phpmailer->From;
}
}
}
add_action('phpmailer_init','wp_mail_returnpath_phpmailer_init');
https://plugins.trac.wordpress.org/browser/wp-mail-returnpath/trunk/index.php
Related Posts:
- WordPress refuses to send mail, “…your host may have disabled the mail() function”
- How do I override the Message-ID header of wp_mail function?
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- PHP 8, AJAX mail form to function.php doesn’t work
- How to retrieve the sender email with wp_mail()?
- Wp_mail doesnt work
- get_post_meta is always empty when I use wp_mail
- How can I send an email using PHP?
- WordPress “phpmailer_init” not working for me
- WordPress new user / forgot password emails are broken
- wp_mail function timing out
- How to disable wordpress confirmation email for new users
- Why is my get_post_meta always empty
- Best way to create a user programatically
- Error when requesting password reset email – wp authentication
- Send PDF link in email based on radio button selection
- Woocommerce HTML email option unavailable
- Trigger Woocommerce New User Email
- wp_mail not sending
- Validate emails in array using foreach
- Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Set a condition based on WooCommerce checkout city field while placing order
- Redirect to another page after submission using wp_mail
- WooCommerce – Email admin with new user details
- How do you ensure that a user is recognised and available for use only when it is verified through a row in the database called ‘accountVerified’?
- Capture User Email Address When Filling Out Form
- Send multiple attachments with wp_mail in PHP
- wp_mail file attachment not being placed in upload folder?
- Website needs to be opened for wp_mail to work
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Can I get an email notification when media is uploaded to the media library?
- Notify users only on post publish
- Sending a custom form data in email through WP Mail Function
- Woocommerce Email attachments not working – file not being attached
- Pass Variables or Variable Place-Holder from Editor to PHP
- Get user custom field value on function.php
- Send notification email to admin for every new post published
- difference between sanitize_email ,FILTER_VALIDATE_EMAIL and input email type in html5
- Different SMTP based on domain
- Use of antispambot with $curauth->email
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- Contact form – problem with displaying message about sent mail
- Get page permalink in contact form
- 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
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Running SMTP Conditionally
- I want to fusion the product columns in email table order
- Woocommerce checkout page – custom field checkbox value into email
- Including user data in “new user notification email”
- Cron not sending wp-mail()
- Email always ends up in spam
- Premature end of script headers: wp-mail.php?
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Send email to users when they get new followers
- Adding action item to admin users table and sending email
- How can disable wordpress emails notifications?
- 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
- Trying send mail from Theme page
- Cron job to call php to email last 24 hours posts
- How to check “From Email” via WordPress before an email is sent
- Adding multiple emails to a
- How to show value from ACF plugin field in e-mail?
- How can I prevent wordpress from sending emails
- wp_mail vs mail functions and header arrays
- Dynamic Email Handler with ‘header (“Location: …’
- Customize the summary table of an order in the email
- Why does WordPress not send the user the email to add a password?
- Word press – JSPDF – Sending PDF as attachment from wp_mail – Special characters
- Why is my custom email notification after purchase not sending?
- What is the best php version to use with WordPress?
- How to call a function only once (global variable scope)
- How to make WordPress plugin check for database changes and then do something?
- wp_get_attachment_url filter won’t accept two arguments
- nowplaying.include.php Will Not Display Results
- Am I not understanding plugins?
- Vagrantpress + composer
- How to set a min number of words for a blog post
- Update postmeta after theme switch
- Woocommerce custom Plugin in wordpress [closed]
- Implementing custom tag/tax pages
- Replace Post-Title with variable
- WordPress loop is not working
- Edit and delete permissions pages and posts
- Problem with my Login Plugin
- Suddenly got alert when trying to login to admin panel of wordpress
- wordpress more than one ajax request at the same time issue
- How to display recently modified posts on recent post widget in wordpress
- PHP Shortcode – 500 error
- Non-array argument in array_merge()-function [closed]
- Dynamically append custom post type to end of url
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Pagination in category.php not functioning
- WordPress Query – Blog Cards Duplicate issue