In wp_mail() there are filters to adjust from address:
// Plugin authors can override the potentially troublesome default
$phpmailer->From = apply_filters( 'wp_mail_from' , $from_email );
$phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
However they don’t seem convenient for your needs because they don’t provide access to mailer object at the same time.
You are probably better of using action hook further down
do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
to check what $From field in it holds and adjust if necessary.
Related Posts:
- How can I send an email using PHP?
- 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?
- How to disable wordpress confirmation email for new users
- Best way to create a user programatically
- Should I use wp_mail or PHP’s mail? [duplicate]
- Mail not sent when I set HTML headers
- Send PDF link in email based on radio button selection
- Woocommerce HTML email option unavailable
- Trigger Woocommerce New User Email
- Processing a subscription form with POST method?
- Different Webhost and using Google Mail server: Is there a better way than SMTP?
- 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
- 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’?
- PHP 8, AJAX mail form to function.php doesn’t work
- Capture User Email Address When Filling Out Form
- Send multiple attachments with wp_mail in PHP
- How to retrieve the sender email with wp_mail()?
- 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?
- Woocommerce Email attachments not working – file not being attached
- 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
- 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
- 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
- Woocommerce checkout page – custom field checkbox value into email
- Changing default WPMU emails to be send thorugh Campaign Monitor Transactional emails
- Send email to users when they get new followers
- 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
- Wp_mail doesnt work
- Trying send mail from Theme page
- get_post_meta is always empty when I use wp_mail
- Cron job to call php to email last 24 hours posts
- Adding multiple emails to a
- How can I prevent wordpress from sending emails
- 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?
- Why is my custom email notification after purchase not sending?
- Send emails to individual subscribers when CPT post is deleted (trashed)
- WordPress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)
- PHP mail function doesn’t complete sending of e-mail
- external wordpress pages using wp-blog-header
- Why WordPress uses 4 tables to manage terms
- Append a term to WooCommerce product existing product category terms
- user_id error: Only variables should be passed by reference
- How can I add pagination and how can I change thumbnail size?
- APC 500 Internal server error [closed]
- Call External Object in Class Function During Callback
- Why do WordPress rewriites seem to work differently for posts vs pages?
- Performance impact of rewriting WordPress URLs
- wp_ob_end_flush_all and wp_suspend_cache_addition()
- edit_comment_link is not showing for comment author
- Css loads very slow [closed]
- Why is image hard cropping for one image using add_image_size not working?
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- If has $title in widgets
- get href content [closed]
- Change “No Comments” link to “My String” on Blog Post (Find Snippet in Code or use CSS, PHP Solution) [closed]
- How to say if meta_value is greater than 0 in an array?
- Adding a tag_ID column into Categories inside the admin dashboard?
- Best Way to Change a String in a WordPress Post
- Show get_sub_field value if it exists [closed]
- How to wrap every 3 posts in a div (and close the last div too) [closed]
- How to Display a List of Child Pages For a Parent Page in WordPress
- User meta needed in query is serialized – how to unserialize safely?
- PHP calling AJAX function that relies on passed PHP function values not working
- Order by title Child Pages displayed in a Parent Page
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Intermittent problem can the debug log give any clues?
- Echo short code syntax
- How to get total gross revenue for current month in the woocommerce dashboard status widget
- PHP is_embed error showing up
- How fix error in the WordPress loop?
- Run code before WordPress loads and insert data into WP if need be
- need help to arabic text in wordpress
- Sorting Meta Fields?
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Functions.php file in a custom child theme messed up without backup
- How do I empty a specific meta_value for all users in PHP
- Import users and custom user meta from csv
- How to enable REST API on custom post type without Gutenberg?
- Creating a table via dbDelta
- wpbd to connect to a VPS mysql database
- How call WordPress shortcode inside function file
- How to Customize the Admin Sidebar Menu in WordPress Multisite Network by changing the backend code of the wp-admin code files?
- How can I allow a user to add any number of custom user_meta fields on a WordPress front-end page?
- When a foreach loop is used multiple times in blocks, is there a way to ensure a variable always has a unique value?